diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml index 106fa8c43..94882a78d 100644 --- a/.github/workflows/pandoc.yml +++ b/.github/workflows/pandoc.yml @@ -27,7 +27,7 @@ jobs: id: pages uses: actions/configure-pages@v5 - name: Build with Pandoc - run: make BASE=${{ steps.pages.outputs.base_path }} + run: make BASE_URL=${{ steps.pages.outputs.base_url }} BASE_PATH=${{ steps.pages.outputs.base_path }} - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/Makefile b/Makefile index 8d9ddf193..ec05cba36 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ -BASE = +BASE_URL = +BASE_PATH = + SITE = _site PAGES = $(filter-out index, $(basename $(notdir $(wildcard md/*.md)))) CONTENT = $(addprefix $(SITE)/, etc css img index.html $(addsuffix /index.html, $(PAGES))) -PANDOC = pandoc --defaults defaults.yml --metadata base=$(abspath $(BASE)) +PANDOC = pandoc -d defaults.yml -M base_url=$(BASE_URL) -M base_path=$(BASE_PATH) MKDIR = mkdir -p CP = cp -r @@ -20,7 +22,7 @@ $(SITE)/%: % $(SITE)/%.html $(SITE)/%/index.html: md/%.md @echo ">> Converting $^" @$(MKDIR) $(@D) - @$(PANDOC) --metadata page=$* --output $@ $^ + @$(PANDOC) -M page=$* -o $@ $^ serve: @python3 -m http.server --bind 127.0.0.1 --directory $(SITE) diff --git a/filters.lua b/filters.lua index 9088ae658..85c9644fa 100644 --- a/filters.lua +++ b/filters.lua @@ -12,9 +12,9 @@ end function change_meta(m) meta = m if m.page == "index" then - m.canonical = stringify(m.baseurl) .. "/" + m.canonical = stringify(m.base_url) .. "/" else - m.canonical = stringify(m.baseurl) .. "/" .. m.page .. "/" + m.canonical = stringify(m.base_url) .. "/" .. m.page .. "/" end m.title = title or m.site_title return m @@ -24,14 +24,14 @@ function change_link_target(l) if meta[l.target] then l.target = stringify(meta[l.target]) elseif l.target:sub(1, 1) == "/" then - l.target = meta.base .. l.target + l.target = meta.base_path .. l.target end return l end function change_image_src(i) if i.src:sub(1, 1) == "/" then - i.src = meta.base .. i.src + i.src = meta.base_path .. i.src end return i end diff --git a/metadata.yml b/metadata.yml index 9d54f67cb..c7323005a 100644 --- a/metadata.yml +++ b/metadata.yml @@ -2,8 +2,6 @@ site_title: Red Pitaya Notes description: Notes on the Red Pitaya Open Source Instrument -baseurl: https://pavel-demin.github.io/red-pitaya-notes - source: https://github.com/pavel-demin/red-pitaya-notes issues: https://github.com/pavel-demin/red-pitaya-notes/issues diff --git a/page.html b/page.html index deddebcd0..a1ab1996f 100644 --- a/page.html +++ b/page.html @@ -6,13 +6,13 @@ - + ${title}
-${site_title} +${site_title}
Source