Skip to content

Commit 96b7374

Browse files
committed
Initialise site
1 parent bca03fb commit 96b7374

File tree

8 files changed

+232
-0
lines changed

8 files changed

+232
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["master"]
7+
8+
permissions: {}
9+
10+
jobs:
11+
deploy:
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Setup Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: 3.14
30+
cache: 'pip'
31+
cache-dependency-path: '**/requirements*.txt'
32+
- name: Install dependencies
33+
uses: py-actions/py-dependency-install@v4
34+
with:
35+
path: requirements.txt
36+
- name: Build site
37+
run: python3 -We -m pelican -s publishconf.py
38+
- name: Setup Pages
39+
uses: actions/configure-pages@v5
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: 'output/'
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4
47+

Makefile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
PY?=
2+
PELICAN?=pelican
3+
PELICANOPTS=
4+
5+
BASEDIR=$(CURDIR)
6+
INPUTDIR=$(BASEDIR)/content
7+
OUTPUTDIR=$(BASEDIR)/output
8+
CONFFILE=$(BASEDIR)/pelicanconf.py
9+
PUBLISHCONF=$(BASEDIR)/publishconf.py
10+
11+
GITHUB_PAGES_BRANCH=gh-pages
12+
GITHUB_PAGES_COMMIT_MESSAGE=Generate Pelican site
13+
14+
15+
DEBUG ?= 0
16+
ifeq ($(DEBUG), 1)
17+
PELICANOPTS += -D
18+
endif
19+
20+
RELATIVE ?= 0
21+
ifeq ($(RELATIVE), 1)
22+
PELICANOPTS += --relative-urls
23+
endif
24+
25+
SERVER ?= "0.0.0.0"
26+
27+
PORT ?= 0
28+
ifneq ($(PORT), 0)
29+
PELICANOPTS += -p $(PORT)
30+
endif
31+
32+
33+
help:
34+
@echo 'Makefile for a pelican Web site '
35+
@echo ' '
36+
@echo 'Usage: '
37+
@echo ' make html (re)generate the web site '
38+
@echo ' make clean remove the generated files '
39+
@echo ' make regenerate regenerate files upon modification '
40+
@echo ' make publish generate using production settings '
41+
@echo ' make serve [PORT=8000] serve site at http://localhost:8000'
42+
@echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
43+
@echo ' make devserver [PORT=8000] serve and regenerate together '
44+
@echo ' make devserver-global regenerate and serve on 0.0.0.0 '
45+
@echo ' '
46+
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
47+
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
48+
@echo ' '
49+
50+
html:
51+
"$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
52+
53+
clean:
54+
[ ! -d "$(OUTPUTDIR)" ] || rm -rf "$(OUTPUTDIR)"
55+
56+
regenerate:
57+
"$(PELICAN)" -r "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
58+
59+
serve:
60+
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
61+
62+
serve-global:
63+
"$(PELICAN)" -l "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -b $(SERVER)
64+
65+
devserver:
66+
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS)
67+
68+
devserver-global:
69+
"$(PELICAN)" -lr "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(CONFFILE)" $(PELICANOPTS) -b 0.0.0.0
70+
71+
publish:
72+
"$(PELICAN)" "$(INPUTDIR)" -o "$(OUTPUTDIR)" -s "$(PUBLISHCONF)" $(PELICANOPTS)
73+
74+
75+
.PHONY: html help clean regenerate serve serve-global devserver devserver-global publish

content/images/aiohttp.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Title: Welcome to the aio-libs site
2+
3+
This is the first post for the new aio-libs website.
4+
5+
Some further content.

content/pages/aiohttp.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Title: Aiohttp
2+
3+
![]({static}/images/aiohttp.svg)
4+
5+
An asynchronous HTTP Client/Server for asyncio and Python.
6+
7+
Client example:
8+
9+
:::python
10+
import aiohttp
11+
import asyncio
12+
13+
async def main():
14+
15+
async with aiohttp.ClientSession() as session:
16+
async with session.get('http://python.org') as response:
17+
18+
print("Status:", response.status)
19+
print("Content-type:", response.headers['content-type'])
20+
21+
html = await response.text()
22+
print("Body:", html[:15], "...")
23+
24+
asyncio.run(main())
25+
26+
Server example:
27+
28+
:::python
29+
from aiohttp import web
30+
31+
async def handle(request):
32+
name = request.match_info.get('name', "Anonymous")
33+
text = "Hello, " + name
34+
return web.Response(text=text)
35+
36+
app = web.Application()
37+
app.add_routes([web.get('/', handle),
38+
web.get('/{name}', handle)])
39+
40+
if __name__ == '__main__':
41+
web.run_app(app)

pelicanconf.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
AUTHOR = 'aio-libs'
2+
SITENAME = 'aio-libs'
3+
SITEURL = ""
4+
SUMMARY_MAX_PARAGRAPHS = 1
5+
6+
PATH = "content"
7+
ARTICLE_PATHS = ["news"]
8+
9+
TIMEZONE = 'UTC'
10+
11+
DEFAULT_LANG = 'en'
12+
13+
# Feed generation is usually not desired when developing
14+
FEED_ALL_ATOM = None
15+
CATEGORY_FEED_ATOM = None
16+
TRANSLATION_FEED_ATOM = None
17+
AUTHOR_FEED_ATOM = None
18+
AUTHOR_FEED_RSS = None
19+
20+
# Blogroll
21+
LINKS = (
22+
("Pelican", "https://getpelican.com/"),
23+
("Python.org", "https://www.python.org/"),
24+
("Jinja2", "https://palletsprojects.com/p/jinja/"),
25+
("You can modify those links in your config file", "#"),
26+
)
27+
28+
# Social widget
29+
SOCIAL = (
30+
("You can add links in your config file", "#"),
31+
("Another social link", "#"),
32+
)
33+
34+
DEFAULT_PAGINATION = 10
35+
36+
# Uncomment following line if you want document-relative URLs when developing
37+
# RELATIVE_URLS = True

publishconf.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is only used if you use `make publish` or
2+
# explicitly specify it as your config file.
3+
4+
import os
5+
import sys
6+
7+
sys.path.append(os.curdir)
8+
from pelicanconf import *
9+
10+
# If your site is available via HTTPS, make sure SITEURL begins with https://
11+
SITEURL = ""
12+
RELATIVE_URLS = False
13+
TYPOGRIFY = True
14+
TYPOGRIFY_OMIT_FILTERS = ["amp", "caps", "initial_quotes", "widont"]
15+
16+
FEED_ALL_ATOM = "feeds/all.atom.xml"
17+
CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml"
18+
19+
DELETE_OUTPUT_DIRECTORY = True
20+
21+
# Following items are often useful when publishing
22+
23+
# DISQUS_SITENAME = ""
24+
# GOOGLE_ANALYTICS = ""

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Pelican[markdown]==4.11.0
2+
typogrify==2.1.0

0 commit comments

Comments
 (0)