From cbe02681d576e5cff5c217a61e0fd9c528a1b5b7 Mon Sep 17 00:00:00 2001 From: timurgordon Date: Tue, 5 Dec 2023 15:58:10 +0300 Subject: [PATCH] add 3script preprocessing --- .gitignore | 2 +- config.toml | 2 +- content/home/index.md | 19 +++++++++++++++++++ run.vsh | 27 +++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 run.vsh diff --git a/.gitignore b/.gitignore index c933db3..0d71d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,10 @@ yarn.lock package-lock.json dist .temp -run* install* public public/* public/home/index.html static/css tailwindcss +tmp_content \ No newline at end of file diff --git a/config.toml b/config.toml index 62781c2..7935df8 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ # The URL the site will be built for -base_url = "https://www2.something.tf/" +base_url = "http://localhost:8089/" # Change this to your own URL! Please note this variable **must** be uncommented. title = "A Template Website" diff --git a/content/home/index.md b/content/home/index.md index b62014a..c2f08b8 100644 --- a/content/home/index.md +++ b/content/home/index.md @@ -7,6 +7,25 @@ draft: false weight: 1 --- +!!flowrift.hero + subtext: '' + header: 'Une fleur pour la paix' + description: 'Dr Denis Mukwege is a world-renowned gynaecologist, human rights activist and Nobel Peace Prize laureate from east Congo. He has become the worlds leading specialist in the treatment of wartime sexual violence and a global campaigner against the use of rape as a weapon of war. Dr Mukwege is running for president and wants to restore peace and defeat hunger.' + image: 'home/flowers4peace.jpeg' + blue_btn_label: 'Learn more' + blue_btn_url: '#' + gray_btn_label: 'Donate' + gray_btn_url: '#' + + +!!flowrift.cta + header: 'Call to Action!' + subheader: 'Up to 70% off.' + description: 'This is a section of some simple filler text, also known as placeholder text. It shares some characteristics of a real written text.' + button_label: 'Save now' + button_url: '/save_now' + image: 'https://images.unsplash.com/photo-1505846951821-e25bacf2eccd?auto=format&q=75&fit=crop&crop=top&w=1000&h=500' + {% row(style="center" margin="tight" bgPath="flower.png" bgStyle="full") %} diff --git a/run.vsh b/run.vsh new file mode 100644 index 0000000..ca96b0b --- /dev/null +++ b/run.vsh @@ -0,0 +1,27 @@ +import freeflowuniverse.webcomponents.preprocessor +import freeflowuniverse.webcomponents.tailwind +import vweb +import os + +pub struct App { + vweb.Context +} + +fn main() { + cp_all('${dir(@FILE)}/content', '${dir(@FILE)}/tmp_content', true)! + preprocessor.preprocess('${os.dir(@FILE)}/content')! + rmdir_all('public')! + rmdir_all('static/css')! + execute('./tailwindcss -i css/index.css -o ./static/css/index.css --minify') + execute('zola build') + execute('rsync -a ${dir(@FILE)}/tmp_content/ ${dir(@FILE)}/content/') + rmdir_all('${dir(@FILE)}/tmp_content')! + + mut app := App{} + app.mount_static_folder_at('${dir(@FILE)}/public', '/') + vweb.run(&app, 8089) +} + +pub fn (mut app App) index() vweb.Result { + return app.html(read_file('./public/index.html') or { panic(err) }) +}