commit a41f3baa8437083c44327f4e0c856a374aca917f Author: ayakael Date: Mon Mar 31 15:27:36 2025 -0400 Initial commit diff --git a/.domains b/.domains new file mode 100644 index 0000000..1f72573 --- /dev/null +++ b/.domains @@ -0,0 +1 @@ +gripuqam.org.grip-uqam.ilot.io diff --git a/.forgejo/workflows/cleanup.yaml b/.forgejo/workflows/cleanup.yaml new file mode 100644 index 0000000..edb7bc4 --- /dev/null +++ b/.forgejo/workflows/cleanup.yaml @@ -0,0 +1,32 @@ +on: + pull_request: + types: [ closed, merged ] + +jobs: + cleanup: + runs-on: x86_64 + container: + image: alpine:latest + steps: + - name: Environment setup + run: | + apk add git nodejs jq coreutils curl tree gawk grep + - name: Pages repo pull + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: pages + - name: Render website + run: | + export GITHUB_PR_NAME=$(grep -l ${{ github.sha }} previews/*/git_sha.txt | awk -F '/' '{print $2}') + echo $GITHUB_PR_NAME >> $GITHUB_ENV + rm -rf previews/$GITHUB_PR_NAME || true + cd previews + tree -d -H '.' -L 1 --noreport --charset utf-8 -T "Versions" -o index.html + - name: Website upload + run: | + git config user.name "forgejo-actions[bot]" + git config user.email "dev@ayakael.net" + git add . + git commit -m "Clean-up $GITHUB_PR_NAME" + git push diff --git a/.forgejo/workflows/pages.yaml b/.forgejo/workflows/pages.yaml new file mode 100644 index 0000000..e37c097 --- /dev/null +++ b/.forgejo/workflows/pages.yaml @@ -0,0 +1,41 @@ +on: + push: + branches: + - 'main' + +jobs: + render: + runs-on: x86_64 + container: + image: alpine:latest + steps: + - name: Environment setup + run: | + apk add git ikiwiki po4a perl-yaml-tiny tree nodejs imagemagick-perlmagick imagemagick imagemagick-jpeg findutils bash imagemagick-webp + - name: Repo pull + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Pages repo pull + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: pages + path: public + - name: Render website + run: ikiwiki --setup ikiwiki.setup + - name: Website upload + run: | + cp .pages-domains public/.domains + cp .pages-redirect public/_redirects + git log -1 --pretty=%B > commit.txt + cd public + find -name 'index.html' -type 'l' -delete + find -name 'index.fr.html' -exec bash -c 'ln -s "${0/.*\/}" "${0/.fr/}"' {} \; + date > generated.txt + # Note: the following account information will not work on GHES + git config user.name "forgejo-actions[bot]" + git config user.email "dev@ayakael.net" + git add . + git commit -F ../commit.txt + git push diff --git a/.forgejo/workflows/preview.yaml b/.forgejo/workflows/preview.yaml new file mode 100644 index 0000000..e8ec978 --- /dev/null +++ b/.forgejo/workflows/preview.yaml @@ -0,0 +1,47 @@ +on: + pull_request: + types: [ assigned, opened, synchronize, reopened ] + +jobs: + preview: + runs-on: x86_64 + container: + image: alpine:latest + steps: + - name: Environment setup + run: | + apk add git ikiwiki po4a perl-yaml-tiny tree nodejs jq coreutils curl imagemagick-perlmagick imagemagick imagemagick-jpeg findutils bash imagemagick-webp + echo "GITHUB_PR_NAME=$(curl -Ls ${{ github.server_url }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.ref_name }} -H 'accept: application/json' -H 'Authorization: token ${{ secrets.FORGEJO_TOKEN }}' | jq .title | tr ' ' '-' | tr -d ':' | tr -d '"' | tr '[:upper:]' '[:lower:]' | tr '/' '-' | tr -d ',')" >> $GITHUB_ENV + - name: Repo pull + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Public repo pull + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: pages + path: public + - name: Render website + run: | + rm -rf public/previews/$GITHUB_PR_NAME || true + mkdir -p public/previews/$GITHUB_PR_NAME + sed -i "s|destdir.*|destdir: ./public/previews/$GITHUB_PR_NAME|" ikiwiki.setup + ikiwiki --setup ikiwiki.setup + cd public/previews + tree -d -H '.' -L 1 --noreport --charset utf-8 -T "Versions" -o index.html + cd $GITHUB_PR_NAME + find -name 'index.html' -type 'l' -delete + find -name 'index.fr.html' -exec bash -c 'ln -s "${0/.*\/}" "${0/.fr/}"' {} \; + - name: Website upload + run: | + git log -1 --pretty=%B > commit.txt + cd public + date > previews/$GITHUB_PR_NAME/generated.txt + echo ${{ github.sha }} > previews/$GITHUB_PR_NAME/git_sha.txt + # Note: the following account information will not work on GHES + git config user.name "forgejo-actions[bot]" + git config user.email "dev@ayakael.net" + git add . + git commit -F ../commit.txt + git push diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d3c49eb --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.ikiwiki/ +public/ +http-server/ +*.mo +*.mo~ +*.po~ +*.pot~ +*.pyc +*.swp diff --git a/.pages-domains b/.pages-domains new file mode 100644 index 0000000..119b5a8 --- /dev/null +++ b/.pages-domains @@ -0,0 +1 @@ +pages.gripuqam.org.grip-uqam.ilot.io diff --git a/.pages-redirect b/.pages-redirect new file mode 100644 index 0000000..47549e1 --- /dev/null +++ b/.pages-redirect @@ -0,0 +1 @@ +/index.fr.html index.html 302 diff --git a/css/local.css b/css/local.css new file mode 100644 index 0000000..73b7c13 --- /dev/null +++ b/css/local.css @@ -0,0 +1,177 @@ +/* + * Color palette + */ + +:root { + --bs-danger-rgb: 159, 19, 19; + --bs-primary-rgb: 55, 106, 48; + --bs-secondary-rgb: 255, 255, 255; + --bs-primary: #376A30; + --bs-link-color-rgb: 55, 106, 48; + --bs-link-hover-color-rgb: 40, 89, 33; +} + +.btn-primary, .btn-primary:hover, .btn-primary:active, .btn-primary:visited { + --bs-btn-bg: var(--bs-primary) !important; + --bs-btn-hover-bg: var(--bs-primary) !important; + --bs-btn-border-color: var(--bs-primary) !important; + --bs-btn-active-bg: var(--bs-primary) !important; + --bs-link-color-rgb: 255, 255, 255; + --bs-link-hover-color-rgb: 230, 230, 230; +} + + +/* + * Page width settings + */ + +/* Override bootstrap sass variables for container-max-width */ +@media (min-width: 1400px) { + .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl { + max-width: 1140px; + } +} + +@media (min-width: 1200px) { + .container-lg, .container-md, .container-sm, .container-xl, .container-xxl { + max-width: 1140px; + } +} + +.ratio-4x3 { + @media (min-width: 768px) { + --bs-aspect-ratio: 33.33%; // 1x3 + } +} + +/* Without this images like to pop-out*/ +#content img { + max-width: 100%; +} + +/* + * Caroussel settings + */ + +/* Makes caroussel buttons under caroussel */ +.carousel-control-prev, +.carousel-control-next{ + align-self: flex-end; /* Aligns it at the bottom */ + padding-bottom: 10px; +} + +/* + * Card settings + */ + +.card { + padding: 0px 30px; + position: relative; + border-radius: 6px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); +} + +/* + * Fonts settings + */ + +/* Applies link-underline to a within a div, rather than a directly */ +.link-underline a { + text-decoration-color: rgba(var(--bs-link-color-rgb),var(--bs-link-underline-opacity,1)) !important; +} + +h1, h2, h3, h4, h5 { + --bs-text-opacity: 1; + color: rgba(var(--bs-primary-rgb),var(--bs-text-opacity)) !important; + font-weight: bold; +} + +/* enlarge body point size for charter for larger displays */ +@media (min-device-width: 750px) { + body { + font-size: 20px; + line-height: 1.5; /* default in FF is ~1.48, try seems a bit to sparse */ + } + /* to match the other bootstrap workaround, below */ + blockquote { + font-size: 18px; + } + /* UI elements should be a little more intrusive */ + .btn, .navbar, .footer { + font-size: 22px; + font-weight: bold; + } +} + +/* Font stacks from: https://modernfontstacks.com/#font-stacks */ +.navbar, .footer, body { + font-family: 'OpenDyslexic', Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif; +} + +/* + * Navbar + */ + +/* Language switchers */ +.language-switcher { + font-size: 14px; + background: #f8f8f8; + color: #333; + border-color: #ccc; +} + +.language-switcher:hover { + background: #e6e6e6; +} + +/* Main buttons */ +.action-button:hover { + background: #e6e6e6; +} + +/* In this case used for the language drop-down menu */ +.dropdown-menu li a { + font-size: 14px; + display: block; + padding: 3px 20px; + clear: both; + font-weight: 400; + line-height: 1.42857143; + color: #333; + border-color: #ccc; + white-space: nowrap; +} + +.dropdown-menu { + --bs-dropdown-bg: #fff; + --bs-dropdown-border-color: #000; +} + +.dropdown-menu li a:hover { + background: #e6e6e6; +} + +/* Usually is set automatically by bootstrap, but do it manually to let ikiwiki handle links */ +.nav-link { + --bs-nav-link-padding-y: 5px; + --bs-nav-link-padding-x: 15px; +} + +.nav-link li a, .nav-link .selflink { + display: block; + padding: var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x); + font-size: var(--bs-nav-link-font-size); + font-weight: var(--bs-nav-link-font-weight); + color: #FFFFFF; + text-decoration: none; + transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out; +} + +.nav-link .selflink { + color: #a6a6a6; +} + +.nav-link li a:hover, .nav-link .selflink:hover { + color: #a6a6a6; +} + diff --git a/css/opendyslexic.css b/css/opendyslexic.css new file mode 100644 index 0000000..bbe1c8b --- /dev/null +++ b/css/opendyslexic.css @@ -0,0 +1,36 @@ +@font-face { + font-family: 'opendyslexic'; + src: + src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2'), + url('../fonts/OpenDyslexic-Regular.woff') format('woff'), + url('../fonts/OpenDyslexic-Regular.otp') format('opentype'); + font-style: normal; + font-weight: normal; +} + +@font-face { + font-family: 'opendyslexic'; + src: url('../fonts/OpenDyslexic-Italic.woff2') format('woff2'), + url('../fonts/OpenDyslexic-Italic.woff') format('woff'), + url('../fonts/OpenDyslexic-Italic.otp') format('opentype'); + font-style: italic; + font-weight: normal; +} + +@font-face { + font-family: 'opendyslexic'; + src: url('../fonts/OpenDyslexic-Bold.woff2') format('woff2'), + url('../fonts/OpenDyslexic-Bold.woff') format('woff'), + url('../fonts/OpenDyslexic-Bold.otp') format('opentype'); + font-weight: bold; + font-style: normal; +} + +@font-face { + font-family: 'opendyslexic'; + src: url('../fonts/OpenDyslexic-BoldItalic.woff2') format('woff2'), + url('../fonts/OpenDyslexic-BoldItalic.woff') format('woff'), + url('../fonts/OpenDyslexic-BoldItalic.otp') format('opentype'); + font-weight: bold; + font-style: italic; +} diff --git a/fonts/OpenDyslexic-Bold-Italic.eot b/fonts/OpenDyslexic-Bold-Italic.eot new file mode 100644 index 0000000..2ab1be8 Binary files /dev/null and b/fonts/OpenDyslexic-Bold-Italic.eot differ diff --git a/fonts/OpenDyslexic-Bold-Italic.otf b/fonts/OpenDyslexic-Bold-Italic.otf new file mode 100644 index 0000000..41aee2d Binary files /dev/null and b/fonts/OpenDyslexic-Bold-Italic.otf differ diff --git a/fonts/OpenDyslexic-Bold-Italic.woff b/fonts/OpenDyslexic-Bold-Italic.woff new file mode 100644 index 0000000..3948189 Binary files /dev/null and b/fonts/OpenDyslexic-Bold-Italic.woff differ diff --git a/fonts/OpenDyslexic-Bold-Italic.woff2 b/fonts/OpenDyslexic-Bold-Italic.woff2 new file mode 100644 index 0000000..aa7bcde Binary files /dev/null and b/fonts/OpenDyslexic-Bold-Italic.woff2 differ diff --git a/fonts/OpenDyslexic-Bold.eot b/fonts/OpenDyslexic-Bold.eot new file mode 100644 index 0000000..3ddebe3 Binary files /dev/null and b/fonts/OpenDyslexic-Bold.eot differ diff --git a/fonts/OpenDyslexic-Bold.otf b/fonts/OpenDyslexic-Bold.otf new file mode 100644 index 0000000..7d074cb Binary files /dev/null and b/fonts/OpenDyslexic-Bold.otf differ diff --git a/fonts/OpenDyslexic-Bold.woff b/fonts/OpenDyslexic-Bold.woff new file mode 100644 index 0000000..41886ae Binary files /dev/null and b/fonts/OpenDyslexic-Bold.woff differ diff --git a/fonts/OpenDyslexic-Bold.woff2 b/fonts/OpenDyslexic-Bold.woff2 new file mode 100644 index 0000000..2f04ad1 Binary files /dev/null and b/fonts/OpenDyslexic-Bold.woff2 differ diff --git a/fonts/OpenDyslexic-Italic.eot b/fonts/OpenDyslexic-Italic.eot new file mode 100644 index 0000000..2e52a60 Binary files /dev/null and b/fonts/OpenDyslexic-Italic.eot differ diff --git a/fonts/OpenDyslexic-Italic.otf b/fonts/OpenDyslexic-Italic.otf new file mode 100644 index 0000000..2b15f8f Binary files /dev/null and b/fonts/OpenDyslexic-Italic.otf differ diff --git a/fonts/OpenDyslexic-Italic.woff b/fonts/OpenDyslexic-Italic.woff new file mode 100644 index 0000000..a23797c Binary files /dev/null and b/fonts/OpenDyslexic-Italic.woff differ diff --git a/fonts/OpenDyslexic-Italic.woff2 b/fonts/OpenDyslexic-Italic.woff2 new file mode 100644 index 0000000..00c1908 Binary files /dev/null and b/fonts/OpenDyslexic-Italic.woff2 differ diff --git a/fonts/OpenDyslexic-Regular.eot b/fonts/OpenDyslexic-Regular.eot new file mode 100644 index 0000000..fb3decc Binary files /dev/null and b/fonts/OpenDyslexic-Regular.eot differ diff --git a/fonts/OpenDyslexic-Regular.otf b/fonts/OpenDyslexic-Regular.otf new file mode 100644 index 0000000..ebef13c Binary files /dev/null and b/fonts/OpenDyslexic-Regular.otf differ diff --git a/fonts/OpenDyslexic-Regular.woff b/fonts/OpenDyslexic-Regular.woff new file mode 100644 index 0000000..26a2934 Binary files /dev/null and b/fonts/OpenDyslexic-Regular.woff differ diff --git a/fonts/OpenDyslexic-Regular.woff2 b/fonts/OpenDyslexic-Regular.woff2 new file mode 100644 index 0000000..47e26d8 Binary files /dev/null and b/fonts/OpenDyslexic-Regular.woff2 differ diff --git a/fonts/opendyslexic-characters.pdf b/fonts/opendyslexic-characters.pdf new file mode 100644 index 0000000..ca6fa12 Binary files /dev/null and b/fonts/opendyslexic-characters.pdf differ diff --git a/footer.html b/footer.html new file mode 100644 index 0000000..f1434b2 --- /dev/null +++ b/footer.html @@ -0,0 +1,15 @@ +
+

Liens intéressants

+ +
diff --git a/ikiwiki.setup b/ikiwiki.setup new file mode 100644 index 0000000..fb994b0 --- /dev/null +++ b/ikiwiki.setup @@ -0,0 +1,416 @@ +# IkiWiki::Setup::Yaml - YAML formatted setup file +# +# Setup file for ikiwiki. +# +# Passing this to ikiwiki --setup will make ikiwiki generate +# wrappers and build the wiki. +# +# Remember to re-run ikiwiki --setup any time you edit this file. +# +# name of the wiki +wikiname: GRIP-UQAM +# contact email for wiki +adminemail: support@ilot.io +# users who are wiki admins +adminuser: [] +# users who are banned from the wiki +banned_users: [] +# where the source of the wiki is located +srcdir: ./ +# where to build the wiki +destdir: ./public +# base url to the wiki +url: https://grip-uqam.org +# url to the ikiwiki.cgi +cgiurl: '' +# do not adjust cgiurl if CGI is accessed via different URL +reverse_proxy: 0 +# filename of cgi wrapper to generate +cgi_wrapper: '' +# mode for cgi_wrapper (can safely be made suid) +cgi_wrappermode: 06755 +# number of seconds to delay CGI requests when overloaded +cgi_overload_delay: '' +# message to display when overloaded (may contain html) +cgi_overload_message: '' +# enable optimization of only refreshing committed changes? +only_committed_changes: 0 +# rcs backend to use +rcs: '' +# plugins to add to the default configuration +add_plugins: +- html +- goodstuff +- favicon +- highlight +- typography +- sidebar2 +- inline +# plugins to disable +disable_plugins: +- htmlscrubber +# additional directory to search for template files +templatedir: ./templates +#templatedir: /usr/share/ikiwiki/templates +# base wiki source location +#underlaydir: /usr/share/ikiwiki/basewiki +# display verbose messages? +verbose: 1 +# log to syslog? +#syslog: 1 +# create output files named page/index.html? +usedirs: 1 +# use '!'-prefixed preprocessor directives? +prefix_directives: 1 +# use page/index.mdwn source files +indexpages: 0 +# enable Discussion pages? +discussion: 1 +# name of Discussion pages +discussionpage: Discussion +# use elements new in HTML5 like
? +html5: 1 +# only send cookies over SSL connections? +sslcookie: 0 +# extension to use for new pages +default_pageext: mdwn +# extension to use for html files +htmlext: html +# strftime format string to display date +timeformat: '%c' +# UTF-8 locale to use +#locale: en_US.UTF-8 +# put user pages below specified page +userdir: '' +# how many backlinks to show before hiding excess (0 to show all) +numbacklinks: 10 +# attempt to hardlink source files? (optimisation for large files) +hardlink: 0 +# force ikiwiki to use a particular umask (keywords public, group or private, or a number) +#umask: public +# group for wrappers to run in +#wrappergroup: ikiwiki +# extra library and plugin directories +libdirs: [plugins] +# extra library and plugin directory (searched after libdirs) +libdir: '' +# environment variables +ENV: {} +# time zone name +timezone: :/etc/localtime +# regexp of normally excluded files to include +#include: ^\.htaccess$ +# regexp of files that should be skipped +exclude: ^(tools/.*|public/.*|plugins/.*)$ +# specifies the characters that are allowed in source filenames +wiki_file_chars: -[:alnum:]+/.:_ +# allow symlinks in the path leading to the srcdir (potentially insecure) +allow_symlinks_before_srcdir: 0 +# cookie control +cookiejar: + file: ~/.ikiwiki/cookies +# set custom user agent string for outbound HTTP requests e.g. when fetching aggregated RSS feeds +useragent: ikiwiki/3.20160509 +# theme has a responsive layout? (mobile-optimized) +responsive_layout: 1 +# try harder to produce deterministic output +deterministic: 0 + +###################################################################### +# core plugins +# (editpage, htmlscrubber, inline, link, meta, parentlinks, templatebody) +###################################################################### + +# htmlscrubber plugin +# PageSpec specifying pages not to scrub +#htmlscrubber_skip: '!*/Discussion' + +# inline plugin +# enable rss feeds by default? +#rss: 0 +# enable atom feeds by default? +#atom: 0 +# allow rss feeds to be used? +#allowrss: 0 +# allow atom feeds to be used? +#allowatom: 0 +# urls to ping (using XML-RPC) on feed update +pingurl: [] + +###################################################################### +# auth plugins +# (anonok, blogspam, emailauth, httpauth, lockedit, moderatedcomments, +# opendiscussion, openid, passwordauth, signinedit) +###################################################################### + +# anonok plugin +# PageSpec to limit which pages anonymous users can edit +#anonok_pagespec: '*/discussion' + +# blogspam plugin +# PageSpec of pages to check for spam +#blogspam_pagespec: postcomment(*) +# options to send to blogspam server +#blogspam_options: blacklist=1.2.3.4,blacklist=8.7.6.5,max-links=10 +# blogspam server JSON url +#blogspam_server: '' + +# emailauth plugin +# email address to send emailauth mails as (default: adminemail) +#emailauth_sender: '' + +# httpauth plugin +# url to redirect to when authentication is needed +#cgiauthurl: http://example.com/wiki/auth/ikiwiki.cgi +# PageSpec of pages where only httpauth will be used for authentication +#httpauth_pagespec: '!*/Discussion' + +# lockedit plugin +# PageSpec controlling which pages are locked +#locked_pages: '!*/Discussion' + +# moderatedcomments plugin +# PageSpec matching users or comment locations to moderate +#moderate_pagespec: '*' + +# openid plugin +# url pattern of openid realm (default is cgiurl) +#openid_realm: '' +# url to ikiwiki cgi to use for openid authentication (default is cgiurl) +#openid_cgiurl: '' + +# passwordauth plugin +# a password that must be entered when signing up for an account +#account_creation_password: s3cr1t +# cost of generating a password using Authen::Passphrase::BlowfishCrypt +#password_cost: 8 + +###################################################################### +# format plugins +# (creole, highlight, hnb, html, mdwn, otl, rawhtml, rst, textile, txt) +###################################################################### + +# highlight plugin +# types of source files to syntax highlight +#tohighlight: .c .h .cpp .pl .py Makefile:make +# location of highlight's filetypes.conf +#filetypes_conf: /etc/highlight/filetypes.conf +# location of highlight's langDefs directory +#langdefdir: /usr/share/highlight/langDefs + +# mdwn plugin +# enable multimarkdown features? +#multimarkdown: 0 +# disable use of markdown discount? +#nodiscount: 0 + +###################################################################### +# special-purpose plugins +# (osm, underlay) +###################################################################### + +# osm plugin +# the default zoom when you click on the map link +#osm_default_zoom: 15 +# the icon shown on links and on the main map +#osm_default_icon: ikiwiki/images/osm.png +# the alt tag of links, defaults to empty +#osm_alt: '' +# the output format for waypoints, can be KML, GeoJSON or CSV (one or many, comma-separated) +#osm_format: KML +# the icon attached to a tag, displayed on the map for tagged pages +#osm_tag_default_icon: icon.png +# Url for the OpenLayers.js file +#osm_openlayers_url: http://www.openlayers.org/api/OpenLayers.js +# Layers to use in the map. Can be either the 'OSM' string or a type option for Google maps (GoogleNormal, GoogleSatellite, GoogleHybrid or GooglePhysical). It can also be an arbitrary URL in a syntax acceptable for OpenLayers.Layer.OSM.url parameter. +#osm_layers: +# OSM: GoogleSatellite +# Google maps API key, Google layer not used if missing, see https://code.google.com/apis/console/ to get an API key +#osm_google_apikey: '' + +# underlay plugin +# extra underlay directories to add +#add_underlays: +#- /home/axil/wiki.underlay + +###################################################################### +# web plugins +# (404, attachment, comments, editdiff, edittemplate, getsource, google, +# goto, mirrorlist, remove, rename, repolist, search, theme, userlist, +# websetup, wmd) +###################################################################### + +# attachment plugin +# enhanced PageSpec specifying what attachments are allowed +#allowed_attachments: virusfree() and mimetype(image/*) and maxsize(50kb) +# virus checker program (reads STDIN, returns nonzero if virus found) +#virus_checker: clamdscan - + +# comments plugin +# PageSpec of pages where comments are allowed +#comments_pagespec: blog/* and !*/Discussion +# PageSpec of pages where posting new comments is not allowed +#comments_closed_pagespec: blog/controversial or blog/flamewar +# Base name for comments, e.g. "comment_" for pages like "sandbox/comment_12" +#comments_pagename: '' +# Interpret directives in comments? +#comments_allowdirectives: 0 +# Allow anonymous commenters to set an author name? +#comments_allowauthor: 0 +# commit comments to the VCS +#comments_commit: 1 +# Restrict formats for comments to (no restriction if empty) +#comments_allowformats: mdwn txt + +# getsource plugin +# Mime type for returned source. +#getsource_mimetype: text/plain; charset=utf-8 + +# mirrorlist plugin +# list of mirrors +#mirrorlist: {} +# generate links that point to the mirrors' ikiwiki CGI +#mirrorlist_use_cgi: 1 + +# repolist plugin +# URIs of repositories containing the wiki's source +#repositories: +#- svn://svn.example.org/wiki/trunk + +# search plugin +# path to the omega cgi program +#omega_cgi: /usr/lib/cgi-bin/omega/omega +# use google site search rather than internal xapian index? +#google_search: 1 + +# theme plugin +# name of theme to enable +#theme: night_city + +# websetup plugin +# list of plugins that cannot be enabled/disabled via the web interface +#websetup_force_plugins: [] +# list of additional setup field keys to treat as unsafe +#websetup_unsafe: [] +# show unsafe settings, read-only, in web interface? +#websetup_show_unsafe: 1 + +###################################################################### +# widget gins +# (calendar, color, conditional, cutpaste, date, format, fortune, +# graphviz, haiku, headinganchors, img, linkmap, listdirectives, map, +# more, orphans, pagecount, pagestats, poll, polygen, postsparkline, +# progress, shortcut, sparkline, table, template, teximg, toc, toggle, +# version) +###################################################################### + +# calendar plugin +# base of the archives hierarchy +#archivebase: archives +# PageSpec of pages to include in the archives, if option `calendar_autocreate` is true. +#archive_pagespec: page(posts/*) and !*/Discussion +# autocreate new calendar pages? +#calendar_autocreate: 1 +# if set, when building calendar pages, also build pages of year and month when no pages were published (building empty calendars). +#calendar_fill_gaps: 1 + +# img plugin +# Image formats to process (jpeg, png, gif, svg, pdf or 'everything' to accept all) +#img_allowed_formats: [svg, webp] + +# listdirectives plugin +# directory in srcdir that contains directive descriptions +#directive_description_dir: ikiwiki/directive + +# teximg plugin +# Should teximg use dvipng to render, or dvips and convert? +#teximg_dvipng: '' +# LaTeX prefix for teximg plugin +#teximg_prefix: | +# \documentclass{article} +# \usepackage[utf8]{inputenc} +# \usepackage{amsmath} +# \usepackage{amsfonts} +# \usepackage{amssymb} +# \pagestyle{empty} +# \begin{document} +# LaTeX postfix for teximg plugin +#teximg_postfix: \end{document} + +###################################################################### +# other plugins +# (aggregate, autoindex, brokenlinks, camelcase, ddate, embed, favicon, +# filecheck, flattr, goodstuff, htmlbalance, localstyle, loginselector, +# notifyemail, pagetemplate, pingee, pinger, prettydate, recentchanges, +# recentchangesdiff, relativedate, rsync, sidebar, smiley, +# sortnaturally, tag, testpagespec, trail, transient) +###################################################################### + +# aggregate plugin +# enable aggregation to internal pages? +#aggregateinternal: 1 +# allow aggregation to be triggered via the web? +#aggregate_webtrigger: 0 + +# autoindex plugin +# commit autocreated index pages +#autoindex_commit: 1 + +# camelcase plugin +# list of words to not turn into links +#camelcase_ignore: [] + +# flattr plugin +# userid or user name to use by default for Flattr buttons +#flattr_userid: joeyh + +# pinger plugin +# how many seconds to try pinging before timing out +#pinger_timeout: 15 + +# prettydate plugin +# format to use to display date +#prettydateformat: '%X, %B %o, %Y' + +# recentchanges plugin +# name of the recentchanges page +recentchangespage: recentchanges +# number of changes to track +recentchangesnum: 100 + +# rsync plugin +# command to run to sync updated pages +#rsync_command: rsync -qa --delete . user@host:/path/to/docroot/ + +# sidebar plugin +# show sidebar page on all pages? +#global_sidebars: 1 + +# tag plugin +# parent page tags are located under +#tagbase: tag +# autocreate new tag pages? +#tag_autocreate: 1 +# commit autocreated tag pages +#tag_autocreate_commit: 1 + +# sidebar2 plugin +# https://ikiwiki.info/plugins/contrib/sidebar2/ +global_sidebars: + - sidebar + - sidebar + - "*" + - footer + - footer + - "*" + +# po plugin +# used to set the "master" language +po_master_language: fr|Français +# po_slave_languages is used to set the list of supported "slave" languages +po_slave_languages: +- en|English +# configures what pages are translatable +po_translatable_pages: '' +# used to decide how internal links should be generated, depending on web server features and site-specific preferences. +po_link_to: current diff --git a/index.html b/index.html new file mode 100644 index 0000000..3aaa68f --- /dev/null +++ b/index.html @@ -0,0 +1,264 @@ +[[!meta title="Accueil"]] +[[!meta description="Le Groupe de Recherche d’Intérêt Public du Québec à l’Université du Québec à Montréal (GRIP-UQAM) réunit des personnes de la communauté étudiante uqamienne souhaitant agir de façon équitable en visant le très long terme pour le bien-être social et écologique des collectivités présentes et futures dans une perspective anticoloniale."]] + +
+ Abonne-toi à notre infolettre, dis-nous tes intérêts ou envoie-nous [[un courriel|contact]] ! :) +
+ +
+

Comités du GRIP‑UQAM

+ +

Voici la liste des comités du GRIP‑UQAM :

+ +
+
+
    +
  • [[Centre Social l'Achoppe|index#achoppe]]
  • +
  • [[Coordination|index#coordination]]
  • +
  • [[CRAPAUD|index#crapaud]]
  • +
  • [[Éducation Populaire|index#educpop]]
  • +
  • [[Lueurs|index#lueurs]]
  • +
  • [[Médi@s Libres|index#medialibre]]
  • +
+
+
+
    +
  • [[Projet Accompagnement Solidarité Colombie (PASC)|index#pasc]]
  • +
  • [[SOS Territoire / l'Alliance Mamo en construction|index#sosterritoire]]
  • +
  • [[Stasis|index#stasis]]
  • +
      +
+
+ +

Suivez-nous sur facebook ou instagram !

+ +

Voir les [[anciens comités|ancienscomites].

+ +

Voir les [[questions-réponses|faq]].

+
+ +
+ +

Centre Social l'Achoppe

+ +

Le Centre Social l'Achoppe, anciennement le Collectif + étudiant de lutte pour des lieux urbains libérés (CELLUL) entend lutter contre + la marchandisation de l’espace public, la gentrification des quartiers, la + bétonisation de la ville ainsi que la dérive sécuritaire et la surveillance de + nos milieux.

+ + +
+ + + + + + + +
+ +

Médi@s Libres

+ +

Médias Libres est un collectif de médias alternatifs qui + vise à promouvoir des discours médiatiques alternatifs. Nous travaillons tant à + la production, qu’à la diffusion de projets médiatiques porteurs d’une + perspective originale et critique. Nous oeuvrons également au réseautage des + médias indépendants. Notre démarche est inclusive et nous croyons à l’échange + de connaissances et à l’horizontalité des rapports interpersonnels.

+ +

Activités

+ +
+ +
+ +

Projet Accompagnement Solidarité Colombie (PASC)

+ +

Le Projet Accompagnement + Solidarité Colombie (PASC) est un collectif anticolonial et féministe + basé au « Québec » qui réalise de l’accompagnement auprès de communautés et + organisations colombiennes, tout en dénonçant les intérêts canadiens impliqués + dans le conflit social et armé en Colombie. Nous faisons des liens entre des + luttes ici et là-bas contre l’imposition de projets d’extraction des + ressources.

+ + +
+ +
+ +

SOS Territoire

+ +

SOS Territoire est un comité du [[GRIP-UQAM|a-propos]] et un groupe de + recherche et d’action pour la protection du territoire dans une perspective + d'écologie sociale en visant un rapprochement entre les autochtones et + non-autochtones, notamment à travers l’Alliance Mamo en construction.

+ +

L'Alliance Mamo (Mamo veut dire « ensemble » en + atikamekw nehiromowin) est un projet porté par SOS Territoire. L'Alliance + Mamo se veut un réseau d’action et de communication entre Autochtones et + Allochtones pour la défense de la biodiversité et contre le colonialisme. La + toile ci-contre a été réalisée par l’artiste atikamekw Jacques Newashish lors + de Mitshetuteuat II pour l’Alliance Mamo. Megwetch Monsieur Newashish !

+ +

Le territoire en péril est considéré sous ses diverses formes - forêts, + rivières et lacs, sous-sol, terres cultivables, environnement rural ou urbain + - incluant ses habitant·es : animales/animaux, humain·es et + végétaux/végétales. Les communautés des Premiers Peuples sont des témoins + privilégié·es de l’état des territoires soi-disant « non habités ». Souvent + les premières victimes humaines de la destruction de ces écosystèmes auxquels + leur identité traditionnelle est inextricablement liée, les Autochtones sont + des allié·es essentiel·les de l'écologie sociale afin de se diriger vers une + société écologique et conviviale.

+ +

Au sein du GRIP-UQAM, et lorsque possible en partenariat avec d'autres + comités tels [[Anarchives|index#anarchives]] et le [[PASC|index#pasc]] ou + encore le Cercle des Premières + Nations de l'UQAM (CPNUQAM), le comité SOS Territoire travaille sur + l'aspect anticolonial de l'écologie sociale, notamment à travers le support + matériel (nourriture, transport, audiovisuel) et organisationnel (traduction, + partage des connaissances, mise en contact entre écologistes Autochtones et + Allochtones) en collaboration avec les Autochtones écologistes, ainsi qu'en + partageant et en diffusant les recherches et l'information anticoloniales et + écologistes par des ateliers et des conférences.

+ +

À l'initiative de SOS Territoire, le GRIP-UQAM alloue une partie de son + budget pour financer les initiatives autochtones à travers le Cercle + Aiatshitau Mamu (Luttons Ensemble) qui s’engage à encourager les projets + menés surtout par des autochtones pour la protection des terres sacrées de + l’Île de la Tortue et des projets de décolonisation / justice sociale / + libération juridique pour les Premiers Peuples. Le montant amassé sera + distribué à différents projets par les membres (exclusivement autochtones) du + Cercle.

+ +

SOS Territoire et le CPNUQAM ont des missions complémentaires et + distinctes. Alors que le CPNUQAM soutien l'intégration et le cheminement des + étudiant·es autochtones à la vie universitaire en milieu urbain, promouvoit + et diffuse les cultures autochtones et les réalités que vivent les Premiers + Peuples et établit des liens d'amitié et de coopération entre les Autochtones + et les Allochtones, SOS Territoire éveille les étudiant·es de l'UQAM ainsi + que la communauté uqamienne aux enjeux écologiques et anticoloniaux. Nous + encourageons les alliances avec des autochtones, particulièrement autour des + enjeux écologiques, et nous travaillons, sur demande des communautés + autochtones, à fournir du soutien pratique et académique aux écologistes + autochtones qui protègent leurs territoires ancestraux et aux Autochtones et + Allochtones de la communauté uqamienne qui les appuient.

+ +

Afin de pouvoir travailler avec le CPNUQAM, SOS Territoire utilise leur + méthode de fonctionnement par consensus. Notre plus grosse collaboration à ce + jour avec le CPNUQAM sont les rencontres Mitshetuteuat I à la chaufferie de + l'UQAM en avril 2014 et Mitshetuteuat II à Wemotaci en septembre 2015, d'où + est née l'Alliance Mamo, projet que nous portons depuis cette rencontre.

+ +

SOS Territoire est membre des regroupements écologistes suivants : le Front + commun pour une transition énergétique et le Réseau Québécois des Groupes Écologistes (RQGE). Nous + travaillons fort pour y apporter une perspective anticoloniale.

+ +

Liens du comité SOS Territoire :

+ + + +

Liens pour Mitshetuteuat I :

+ + + +

Liens pour Mitshetuteuat II :

+ +
+ + +
+ +
+ +

Stasis

+ +

Stasis : + Groupe d’enquête sur le contemporain entend, par l’organisation de divers + événements, approfondir ce qui forme l’étoffe des résistances politiques + d’aujourd’hui. Un lieu commun où la confrontation entre différentes positions + favorise l’élaboration d’une perception commune de la situation. Un espace de + création et de réflexion qui vise à élucider ce que seraient une ou des + révolutions à notre époque. La rédaction d’une revue permettra ultimement de + récapituler les enjeux et les thématiques discutés tout au long de l’année.

+ + +
+ diff --git a/plugins/IkiWiki/Plugin/img.pm b/plugins/IkiWiki/Plugin/img.pm new file mode 100644 index 0000000..e4de9e8 --- /dev/null +++ b/plugins/IkiWiki/Plugin/img.pm @@ -0,0 +1,325 @@ +#!/usr/bin/perl +# Ikiwiki enhanced image handling plugin +# Christian Mock cm@tahina.priv.at 20061002 +package IkiWiki::Plugin::img; + +use warnings; +use strict; +use IkiWiki 3.00; + +my %imgdefaults; + +sub import { + hook(type => "getsetup", id => "img", call => \&getsetup); + hook(type => "preprocess", id => "img", call => \&preprocess, scan => 1); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + section => "widget", + }, + img_allowed_formats => { + type => "string", + default => [qw(jpeg png gif svg webp)], + description => "Image formats to process (jpeg, png, gif, svg, webp, pdf or 'everything' to accept all)", + # ImageMagick has had arbitrary code execution flaws, + # and the whole delegates mechanism is scary from + # that perspective + safe => 0, + rebuild => 0, + }, +} + +sub allowed { + my $format = shift; + my $allowed = $config{img_allowed_formats}; + $allowed = ['jpeg', 'png', 'gif', 'svg', 'webp'] unless defined $allowed && @$allowed; + + foreach my $a (@$allowed) { + return 1 if lc($a) eq $format || lc($a) eq 'everything'; + } + + return 0; +} + +sub preprocess (@) { + my ($image) = $_[0] =~ /$config{wiki_file_regexp}/; # untaint + my %params=@_; + + if (! defined $image) { + error("bad image filename"); + } + + if (exists $imgdefaults{$params{page}}) { + foreach my $key (keys %{$imgdefaults{$params{page}}}) { + if (! exists $params{$key}) { + $params{$key}=$imgdefaults{$params{page}}->{$key}; + } + } + } + + if (! exists $params{size} || ! length $params{size}) { + $params{size}='full'; + } + + if ($image eq 'defaults') { + $imgdefaults{$params{page}} = \%params; + return ''; + } + + add_link($params{page}, $image); + add_depends($params{page}, $image); + + # optimisation: detect scan mode, and avoid generating the image + if (! defined wantarray) { + return; + } + + my $file = bestlink($params{page}, $image); + my $srcfile = srcfile($file, 1); + if (! length $file || ! defined $srcfile) { + return htmllink($params{page}, $params{destpage}, $image); + } + + my $dir = $params{page}; + my $base = IkiWiki::basename($file); + my $extension; + my $format; + + if ($base =~ m/\.([a-z0-9]+)$/is) { + $extension = $1; + } + else { + error gettext("Unable to detect image type from extension"); + } + + # Never interpret well-known file extensions as any other format, + # in case the wiki configuration unwisely allows attaching + # arbitrary files named *.jpg, etc. + my $magic; + my $offset = 0; + open(my $in, '<', $srcfile) or error sprintf(gettext("failed to read %s: %s"), $file, $!); + binmode($in); + + if ($extension =~ m/^(jpeg|jpg)$/is) { + $format = 'jpeg'; + $magic = "\377\330\377"; + } + elsif ($extension =~ m/^(png)$/is) { + $format = 'png'; + $magic = "\211PNG\r\n\032\n"; + } + elsif ($extension =~ m/^(gif)$/is) { + $format = 'gif'; + $magic = "GIF8"; + } + elsif ($extension =~ m/^(svg)$/is) { + $format = 'svg'; + } + elsif ($extension =~ m/^(webp)$/is) { + $format = 'webp'; + } + elsif ($extension =~ m/^(pdf)$/is) { + $format = 'pdf'; + $magic = "%PDF-"; + } + else { + # allow ImageMagick to auto-detect (potentially dangerous) + my $im = Image::Magick->new(); + my $r = $im->Ping(file => $in); + if ($r) { + $format = lc $r; + } + else { + error sprintf(gettext("failed to determine format of %s"), $file); + } + } + + error sprintf(gettext("%s image processing disabled in img_allowed_formats configuration"), $format ? $format : "\"$extension\"") unless allowed($format ? $format : "everything"); + + # Try harder to protect ImageMagick from itself + if (defined $magic) { + my $content; + read($in, $content, length $magic) or error sprintf(gettext("failed to read %s: %s"), $file, $!); + if ($magic ne $content) { + error sprintf(gettext("\"%s\" does not seem to be a valid %s file"), $file, $format); + } + } + + my $ispdf = $base=~s/\.pdf$/.png/i; + my $pagenumber = exists($params{pagenumber}) ? int($params{pagenumber}) : 0; + if ($pagenumber != 0) { + $base = "p$pagenumber-$base"; + } + + my $imglink; + my $imgdatalink; + my ($dwidth, $dheight); + + my ($w, $h); + if ($params{size} ne 'full') { + ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/); + } + + if ($format eq 'svg') { + # svg images are not scaled using ImageMagick because the + # pipeline is complex. Instead, the image size is simply + # set to the provided values. + # + # Aspect ratio will be preserved automatically when + # only a width or only a height is specified. + # When both are specified, aspect ratio will not be + # preserved. + $imglink = $file; + $dwidth = $w if length $w; + $dheight = $h if length $h; + } + else { + eval q{use Image::Magick}; + error gettext("Image::Magick is not installed") if $@; + my $im = Image::Magick->new(); + my $r = $im->Read("$format:$srcfile\[$pagenumber]"); + error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r; + + if ($config{deterministic}) { + $im->Set('date:create' => 0); + $im->Set('date:modify' => 0); + $im->Set('option' => 'png:exclude-chunk=time'); + } + + if (! defined $im->Get("width") || ! defined $im->Get("height")) { + error sprintf(gettext("failed to get dimensions of %s"), $file); + } + + if (! length $w && ! length $h) { + $dwidth = $im->Get("width"); + $dheight = $im->Get("height"); + } else { + error sprintf(gettext('wrong size format "%s" (should be WxH)'), $params{size}) + unless (defined $w && defined $h && + (length $w || length $h)); + + if ($im->Get("width") == 0 || $im->Get("height") == 0) { + ($dwidth, $dheight)=(0, 0); + } elsif (! length $w || (length $h && $im->Get("height")*$w > $h * $im->Get("width"))) { + # using height because only height is given or ... + # because original image is more portrait than $w/$h + # ... slimness of $im > $h/w + # ... $im->Get("height")/$im->Get("width") > $h/$w + # ... $im->Get("height")*$w > $h * $im->Get("width") + + $dheight=$h; + $dwidth=$h / $im->Get("height") * $im->Get("width"); + } else { # (! length $h) or $w is what determines the resized size + $dwidth=$w; + $dheight=$w / $im->Get("width") * $im->Get("height"); + } + } + + if ($dwidth < $im->Get("width") || $ispdf) { + # resize down, or resize to pixels at all + + my $outfile = "$config{destdir}/$dir/$params{size}-$base"; + $imglink = "$dir/$params{size}-$base"; + + will_render($params{page}, $imglink); + + if (-e $outfile && (-M $srcfile >= -M $outfile)) { + $im = Image::Magick->new; + $r = $im->Read($outfile); + error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r; + } + else { + $r = $im->Resize(geometry => "${dwidth}x${dheight}"); + error sprintf(gettext("failed to resize: %s"), $r) if $r; + + $im->set($ispdf ? (magick => 'png') : ()); + my @blob = $im->ImageToBlob(); + # don't actually write resized file in preview mode; + # rely on width and height settings + if (! $params{preview}) { + writefile($imglink, $config{destdir}, $blob[0], 1); + } + else { + eval q{use MIME::Base64}; + error($@) if $@; + $imgdatalink = "data:image/".$im->Get("magick").";base64,".encode_base64($blob[0]); + } + } + + # always get the true size of the resized image (it could be + # that imagemagick did its calculations differently) + $dwidth = $im->Get("width"); + $dheight = $im->Get("height"); + } else { + $imglink = $file; + } + + if (! defined($dwidth) || ! defined($dheight)) { + error sprintf(gettext("failed to determine size of image %s"), $file) + } + } + + my ($fileurl, $imgurl); + my $urltobase = $params{preview} ? undef : $params{destpage}; + $fileurl=urlto($file, $urltobase); + $imgurl=$imgdatalink ? $imgdatalink : urlto($imglink, $urltobase); + + if (! exists $params{class}) { + $params{class}="img"; + } + + my $attrs=''; + foreach my $attr (qw{alt title class id hspace vspace}) { + if (exists $params{$attr}) { + $attrs.=" $attr=\"$params{$attr}\""; + } + } + + my $imgtag=''; + + my $link; + if (! defined $params{link}) { + $link=$fileurl; + } + elsif ($params{link} =~ /^\w+:\/\//) { + $link=$params{link}; + } + + if (defined $link) { + $imgtag=''.$imgtag.''; + } + else { + my $b = bestlink($params{page}, $params{link}); + + if (length $b) { + add_depends($params{page}, $b, deptype("presence")); + $imgtag=htmllink($params{page}, $params{destpage}, + $params{link}, linktext => $imgtag, + noimageinline => 1, + ); + } + } + + if (exists $params{caption}) { + return ''. + ''. + ''. + '
'.$params{caption}.'
'.$imgtag.'
'; + } + else { + return $imgtag; + } +} + +1 diff --git a/plugins/IkiWiki/Plugin/sidebar2.pm b/plugins/IkiWiki/Plugin/sidebar2.pm new file mode 100644 index 0000000..5992f91 --- /dev/null +++ b/plugins/IkiWiki/Plugin/sidebar2.pm @@ -0,0 +1,214 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::sidebar2; + +=head1 NAME + +IkiWiki::Plugin::sidebar2 - Improved version of IkiWiki::Plugin::sidebar + +=head1 VERSION + +This describes version B<0.1> of IkiWiki::Plugin::sidebar2 + +=cut + +our $VERSION = '0.1'; + +=head1 DESCRIPTION + +Improved version of IkiWiki::Plugin::sidebar2. Main features are: + +- allowing several sidebars; +- enabling sidebars using pagespects. + +See doc/plugins/sidebar2.mdwn for documentation. + +=head1 PREREQUISITES + +IkiWiki + +=head1 URL + +http://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Sidebar2 +http://ikiwiki.info/plugins/contrib/sidebar2/ + +=head1 AUTHOR + +Tuomo Valkonen wrote the original Ikiwiki::plugin::sidebar. +Others (on http://ikiwiki.info) helped to improve it. +Louis Paternault (spalax) improved it to write Ikiwiki::plugin::sidebar2. + +=head1 COPYRIGHT + +Copyright 2006 Tuomo Valkonen +Copyright 2013 by Louis Paternault + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +=cut + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "checkconfig", id => "sidebar2", call => \&checkconfig); + hook(type => "getsetup", id => "sidebar2", call => \&getsetup); + hook(type => "preprocess", id => "sidebar", call => \&preprocess); + hook(type => "pagetemplate", id => "sidebar2", call => \&pagetemplate); +} + +sub checkconfig () { + # Parsing "sidebars" + my %sidebars; + if (defined $config{global_sidebars} and (ref($config{global_sidebars}) eq "ARRAY")) { + my $length = $#{$config{global_sidebars}}+1; + if (($length % 3) != 0) { + error("'sidebars' length must be a multiple of 3."); + } + for(my $i=0; $i<$length/3;$i += 1) { + unless(exists($sidebars{$config{global_sidebars}[3*$i]})) { + $sidebars{$config{global_sidebars}[3*$i]} = (); + } + push( + @{$sidebars{$config{global_sidebars}[3*$i]}}, + @{[[ + $config{global_sidebars}[3*$i+1], + $config{global_sidebars}[3*$i+2], + ]]} + ); + } + } else { + if (not defined $config{global_sidebars}) { + $config{global_sidebars} = 1; + } + if (IkiWiki::yesno($config{global_sidebars})) { + %sidebars = ( + "sidebar" => [["sidebar", "*"]] + ); + } + } + + @{$config{sidebars}} = %sidebars; +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => 1, + }, + global_sidebars => { + type => "boolean", + example => 1, + description => "show sidebar page on all pages?", + safe => 1, + rebuild => 1, + }, +} + +my %pagesidebar; + +sub preprocess (@) { + my %params=@_; + + my $page=$params{page}; + return "" unless $page eq $params{destpage}; + + if (! defined $params{var}) { + $params{var} = "sidebar"; + } + if (! defined $params{content}) { + $pagesidebar{$page}{$params{var}}=undef; + } + else { + my $file = $pagesources{$page}; + my $type = pagetype($file); + + unless(exists($pagesidebar{$page})) { + $pagesidebar{$page} = (); + } + $pagesidebar{$page}{$params{var}} = IkiWiki::htmlize($page, $page, $type, + IkiWiki::linkify($page, $page, + IkiWiki::preprocess($page, $page, $params{content}))); + } + + return ""; +} + +my $oldfile; +my $oldcontent; + +sub sidebar_content ($$$$) { + my $templatevar=shift; + my $page=shift; + my $included=shift; + my $pagespec=shift; + + return delete $pagesidebar{$page}{$templatevar} if defined $pagesidebar{$page}{$templatevar}; + + return if ! exists $pagesidebar{$page}{$templatevar} && + ! pagespec_match($page, $pagespec) + ; + + my $sidebar_page=bestlink($page, $included) || return; + my $sidebar_file=$pagesources{$sidebar_page} || return; + my $sidebar_type=pagetype($sidebar_file); + + if (defined $sidebar_type) { + # FIXME: This isn't quite right; it won't take into account + # adding a new sidebar page. So adding such a page + # currently requires a wiki rebuild. + add_depends($page, $sidebar_page); + + my $content; + if (defined $oldfile && $sidebar_file eq $oldfile) { + $content=$oldcontent; + } + else { + $content=readfile(srcfile($sidebar_file)); + $oldcontent=$content; + $oldfile=$sidebar_file; + } + + return unless length $content; + return IkiWiki::htmlize($sidebar_page, $page, $sidebar_type, + IkiWiki::linkify($sidebar_page, $page, + IkiWiki::preprocess($sidebar_page, $page, + IkiWiki::filter($sidebar_page, $page, $content)))); + } + +} + +sub pagetemplate (@) { + my %params=@_; + + my $template=$params{template}; + my %sidebars = @{$config{sidebars}}; + if ($params{destpage} eq $params{page}) { + foreach my $templatevar (keys(%sidebars)) { + if ($template->query(name => $templatevar) and exists($sidebars{$templatevar})) { + for my $data (@{$sidebars{$templatevar}}) { + my $content=sidebar_content($templatevar, $params{destpage}, @{$data}[0], @{$data}[1]); + if (defined $content && length $content) { + $template->param($templatevar => $content); + last; + } + } + } + } + } +} + +1 diff --git a/sidebar.html b/sidebar.html new file mode 100644 index 0000000..93727fb --- /dev/null +++ b/sidebar.html @@ -0,0 +1,4 @@ + + diff --git a/templates/page.tmpl b/templates/page.tmpl new file mode 100644 index 0000000..8b8387a --- /dev/null +++ b/templates/page.tmpl @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <TMPL_VAR TITLE> - <TMPL_VAR WIKINAME> + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + +
+ Download +
+
+ + +
+
+ +
+
+ +
+
+ + + + + + + diff --git a/templates/searchform.tmpl b/templates/searchform.tmpl new file mode 100644 index 0000000..6b660b7 --- /dev/null +++ b/templates/searchform.tmpl @@ -0,0 +1,4 @@ + diff --git a/templates/trails.tmpl b/templates/trails.tmpl new file mode 100644 index 0000000..caf36b7 --- /dev/null +++ b/templates/trails.tmpl @@ -0,0 +1,29 @@ + + + + + diff --git a/tools/test-server.sh b/tools/test-server.sh new file mode 100755 index 0000000..cdbe7b1 --- /dev/null +++ b/tools/test-server.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +for i in node npm git; do + if ! command -v $i &> /dev/null; then + echo ">> $i could not be found, please install" + exit + fi +done + +# http-server not pulled, pulling +if [ ! -d "$SCRIPT_DIR/http-server" ]; then + echo ">> This script will pull a lightweight nodejs http-server from https://github.com/http-party/http-server and make ./public avaiable as local http service, are you okay with this?" + read -p "Continue (y/n)?" choice + case "$choice" in + y|Y ) echo "yes";; + n|N ) echo "no";; + * ) echo "invalid";; + esac + git clone https://github.com/http-party/http-server +fi + +# http-server depends not pulled, pulling +if [ ! -d "$SCRIPT_DIR/http-server/node_modules/" ]; then + echo ">> http-server dependencies not pulled, pulling" + npm --prefix "$SCRIPT_DIR"/http-server i +fi + +# website not built, building +if [ ! -d "$SCRIPT_DIR/../public" ]; then + echo ">> website not build, building" + pushd "$SCRIPT_DIR"/.. + ikiwiki --setup ./ikiwiki.setup + popd +fi + +# starting server +echo ">> starting http server" +node "$SCRIPT_DIR"/http-server/bin/http-server -c-1 "$SCRIPT_DIR"/../public