Skip to content

Commit

Permalink
replace 11ty with pandoc
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-demin committed Nov 11, 2024
1 parent 2e8409d commit 82c6fad
Show file tree
Hide file tree
Showing 20 changed files with 148 additions and 155 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/11ty.yml → .github/workflows/pandoc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy 11ty site to Pages
name: Deploy Pandoc site to Pages

on:
push:
Expand All @@ -21,17 +21,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install 11ty
run: npm install
- name: Install Pandoc
run: sudo apt-get update && sudo apt-get -yq install pandoc
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with 11ty
run: npm run build -- --pathprefix ${{ steps.pages.outputs.base_path }}
- name: Build with Pandoc
run: make BASE=${{ steps.pages.outputs.base_path }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

Expand Down
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
BASE =
SITE = _site

PAGES = $(filter-out index, $(basename $(notdir $(wildcard md/*.md))))
CONTENT = $(addprefix $(SITE)/, css img index.html $(addsuffix /index.html, $(PAGES)))

PANDOC = pandoc --defaults defaults.yml --metadata base=$(abspath $(BASE))

MKDIR = mkdir -p
CP = cp -r
RM = rm -rf

all: $(SITE) $(CONTENT)

$(SITE):
@$(MKDIR) $@

$(SITE)/%: %
@echo ">> Copying $^"
@$(MKDIR) $(@D)
@$(CP) $^ $@

$(SITE)/%.html $(SITE)/%/index.html: md/%.md
@echo ">> Converting $^"
@$(MKDIR) $(@D)
@$(PANDOC) --metadata page=$* --output $@ $^

serve:
@python3 -m http.server --bind 127.0.0.1 --directory $(SITE)

clean:
@$(RM) $(SITE)
16 changes: 0 additions & 16 deletions _data/site.js

This file was deleted.

29 changes: 0 additions & 29 deletions _layouts/page.html

This file was deleted.

2 changes: 2 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ html {
Liberation Sans,
DejaVu Sans,
sans-serif;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
text-size-adjust: none;
}

Expand Down
11 changes: 11 additions & 0 deletions defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
standalone: true
template: page.html

reader: markdown-implicit_figures
writer: html

highlight-style: null
wrap: none

metadata-file: metadata.yml
filters: [filters.lua]
52 changes: 0 additions & 52 deletions eleventy.config.js

This file was deleted.

48 changes: 48 additions & 0 deletions filters.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
local meta = {}
local title = nil
local stringify = pandoc.utils.stringify

function get_title(h)
if h.level == 1 and not title then
title = h.content
return h
end
end

function change_meta(m)
meta = m
if m.page == "index" then
m.canonical = stringify(m.baseurl) .. "/"
else
m.canonical = stringify(m.baseurl) .. "/" .. m.page .. "/"
end
m.title = title or m.site_title
return m
end

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
end
return l
end

function change_image_src(i)
if i.src:sub(1, 1) == "/" then
i.src = meta.base .. i.src
end
return i
end

return {
{
Header = get_title,
Meta = change_meta
},
{
Link = change_link_target,
Image = change_image_src
}
}
6 changes: 2 additions & 4 deletions md/alpine.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
title: Alpine with pre-built applications
---
# Alpine with pre-built applications

## Introduction

To simplify maintenance and distribution of the pre-built applications described in the Eclypse Z7 notes, I've put together a bootable SD card image based on the lightweight [Alpine Linux](https://alpinelinux.org) distribution.

## Getting started

- Download [SD card image zip file]({{ site.release_image }}).
- Download [SD card image zip file](release_image).
- Copy the contents of the SD card image zip file to a micro SD card.
- Optionally, to start one of the applications automatically at boot time, copy its `start.sh` file from `apps/<application>` to the topmost directory on the SD card.
- Install the micro SD card in the Eclypse Z7 board and connect the power.
Expand Down
4 changes: 1 addition & 3 deletions md/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: List of components
---
# List of components

The following is a list of components that can be used with Eclypse Z7.

Expand Down
4 changes: 0 additions & 4 deletions md/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
permalink: /
---

1. [List of components](/components/)
1. [Links](/links/)
1. [LED blinker](/led-blinker/)
Expand Down
6 changes: 2 additions & 4 deletions md/led-blinker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: LED blinker
---
# LED blinker

## Introduction

Expand Down Expand Up @@ -107,7 +105,7 @@ Building an SD card image:
sudo sh scripts/alpine.sh
```

A pre-built SD card image can be downloaded from [this link]({{ site.release_image }}).
A pre-built SD card image can be downloaded from [this link](release_image).

To write the image to a micro SD card, copy the contents of the SD card image zip file to a micro SD card.

Expand Down
4 changes: 1 addition & 3 deletions md/links.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Links
---
# Links

- [Digilent documentation for Eclypse Z7](https://digilent.com/reference/programmable-logic/eclypse-z7/start)

Expand Down
4 changes: 0 additions & 4 deletions md/md.json

This file was deleted.

6 changes: 2 additions & 4 deletions md/sdr-receiver-hpsdr.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: SDR receiver compatible with HPSDR
---
# SDR receiver compatible with HPSDR

## Introduction

Expand Down Expand Up @@ -48,7 +46,7 @@ This SDR receiver should work with most of the programs that support the HPSDR/M

## Getting started

- Download [SD card image zip file]({{ site.release_image }}) (more details about the SD card image can be found at [this link](/alpine/)).
- Download [SD card image zip file](release_image) (more details about the SD card image can be found at [this link](/alpine/)).
- Copy the contents of the SD card image zip file to a micro SD card.
- Optionally, to start the application automatically at boot time, copy its `start.sh` file from `apps/sdr_receiver_hpsdr` to the topmost directory on the SD card.
- Install the micro SD card in the Eclypse Z7 board and connect the power.
Expand Down
10 changes: 4 additions & 6 deletions md/sdr-transceiver.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: SDR transceiver
---
# SDR transceiver

## Introduction

Expand Down Expand Up @@ -50,7 +48,7 @@ The [projects/sdr_transceiver/gnuradio](https://github.com/pavel-demin/eclypse-z
## Getting started with GNU Radio

- Connect an antenna to the CH1 connector of the Zmod Digitizer module.
- Download [SD card image zip file]({{ site.release_image }}) (more details about the SD card image can be found at [this link](/alpine/)).
- Download [SD card image zip file](release_image) (more details about the SD card image can be found at [this link](/alpine/)).
- Copy the contents of the SD card image zip file to a micro SD card.
- Optionally, to start the application automatically at boot time, copy its `start.sh` file from `apps/sdr_transceiver` to the topmost directory on the SD card.
- Install the micro SD card in the Eclypse Z7 board and connect the power.
Expand All @@ -77,12 +75,12 @@ gnuradio-companion fm.grc
## Getting started with SDR# and HDSDR

- Connect an antenna to the CH1 connector of the Zmod Digitizer module.
- Download [SD card image zip file]({{ site.release_image }}) (more details about the SD card image can be found at [this link](/alpine/)).
- Download [SD card image zip file](release_image) (more details about the SD card image can be found at [this link](/alpine/)).
- Copy the contents of the SD card image zip file to a micro SD card.
- Optionally, to start the application automatically at boot time, copy its `start.sh` file from `apps/sdr_transceiver` to the topmost directory on the SD card.
- Install the micro SD card in the Eclypse Z7 board and connect the power.
- Download and install [SDR#](https://www.dropbox.com/sh/5fy49wae6xwxa8a/AAAdAcU238cppWziK4xPRIADa/sdr/sdrsharp_v1.0.0.1361_with_plugins.zip?dl=1) or [HDSDR](https://www.hdsdr.de).
- Download [pre-built ExtIO plug-in]({{ site.extio_file }}) for SDR# and HDSDR.
- Download [pre-built ExtIO plug-in](extio_file) for SDR# and HDSDR.
- Copy `extio_red_pitaya.dll` into the SDR# or HDSDR installation directory.
- Start SDR# or HDSDR.
- Select Red Pitaya from the Source list in SDR# or from the Options [F7] &rarr; Select Input menu in HDSDR.
Expand Down
12 changes: 12 additions & 0 deletions metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
site_title: Eclypse Z7 Notes

description: Notes on the Eclypse Z7 development board

baseurl: https://pavel-demin.github.io/eclypse-z7-notes

source: https://github.com/pavel-demin/eclypse-z7-notes
issues: https://github.com/pavel-demin/eclypse-z7-notes/issues

release_image: https://github.com/pavel-demin/eclypse-z7-notes/releases/download/20230222/eclypse-z7-alpine-3.14-armv7-20230222.zip

extio_file: https://www.dropbox.com/scl/fi/pl8gfjn2ay267or1zkohu/extio_red_pitaya.dll?rlkey=zhmv6qktymfeno8bdap94noq9&dl=1
15 changes: 0 additions & 15 deletions package.json

This file was deleted.

Loading

0 comments on commit 82c6fad

Please sign in to comment.