|
2 years ago | |
---|---|---|
bin | 4 years ago | |
data | 3 years ago | |
etc | 3 years ago | |
lib | 4 years ago | |
locales | 2 years ago | |
source | 2 years ago | |
.gitignore | 5 years ago | |
.ruby-version | 4 years ago | |
COPYING | 6 years ago | |
DESIGN.org | 5 years ago | |
Gemfile | 4 years ago | |
Gemfile.lock | 4 years ago | |
README.md | 3 years ago | |
VERSION | 5 years ago | |
config.rb.dist | 4 years ago | |
r-i-gui_03-after-but-before-04_mbr.png | 2 years ago |
This is the source code for beta.devuan.org.
Version note: although this file mentions v0.9.0, it’s not tagged yet. It will be tagged 0.9.0 when released (on the master branch), and should reach 1.0 by Jessie.
Version 0.9.0. We’re using Semantic Versioning.
The source code is free software distributed under the GNU Affero General Public License, version 3, or, at your option, any later version. (See COPYING.)
The website contents are creative commons released under CC-BY-ND-4.0-International.
This is a static Web made with Middleman.
| Directory | File | Description | |---------------------+------------------------+---------------------------| | ./ | config.rb | Middleman configuration | | bin/ | sync | Poor man’s mirroring | | etc/ | | Extra configuration files | | | nginx-development.conf | To run the site locally | | | nginx-production.conf | To deploy publicly | | locales/ | :lang.yml | Localized strings | | source/ | | Web content | | source/layouts | *.erb | Layout templates | | source/pages | *.:lang.html.md.erb | Localized pages | | source/partials | | Partial files (includes) | | source/ui | | User interface files | | source/ui/css | | Stylesheets | | source/ui/css/fonts | | Embedded Web fonts | | source/ui/img | | Image files | | source/ui/js | | Javascript files |
Most pages go under source/pages/os/
. This is to enable local mirrors to
add their own custom contents for their local community.
To deploy the site locally:
You need Ruby (sudo apt install ruby-dev
).
The development files are useful to compile some gems
.
Then you need a couple of ruby packages (gems
):
~$ sudo gem install middleman bundler
They will take care of their dependencies. Lucas Nussbaum and the Debian Ruby team made a fantastic job integrating Ruby in Debian--hence in Devuan.
~$ mkdir -p ~/src/devuan/www && cd $_
www$ git clone https://git.devuan.org/devuan-editors/devuan-www.git devuan.org
www$ cd devuan.org
devuan.org$ export DIR=$PWD
The source code now lives at ~/src/devuan/www/devuan.org
.
We keep track of this path using the variable DIR
.
1 devuan.org$ echo '127.0.0.1 devuan.invalid' | sudo tee -a /etc/hosts
2 devuan.org$ cd /etc/nginx/sites-available
3 sites-available$ sudo ln -s $DIR/etc/nginx-development.conf devuan.invalid
4 sites-available$ cd ../sites-enabled
5 sites-enabled$ sudo ln -s ../sites-available/devuan.invalid
6 sites-enabled$ sudo /etc/init.d/nginx reload
Add a fake host to be able to use the domain
to the end: enable nginx configuration
sites-enabled$ cd $DIR
devuan.org$ bundle exec middleman build
This generates the static files in $DIR/public
.
You can fallback to the backend for non-built files if you run the local middleman server (and edit the NginX configuration):
devuan.org$ bundle exec middleman server -p 4569
Open your browser to http://devuan.invalid
The main site (beta.devuan.org
) is in English by default.
Mirrors should change the default language to set theirs in config.rb
.
Do commit the change, so that it will be kept during updates.
If you want to push the change, use a branch, e.g., fr.devuan.org
:
devuan.org$ git checkout -b fr.devuan.org
Once your mirror is deployed, please send its URL, language, location, and person responsible to the mirror issue, so it can be added to the list. E.g., a mirror in France can be accessed via fr.devuan.org.
You’re welcome to announce your mirror in the Mirroring Devuan discussion space.
source/pages/os
source/pages/os/your-slug-title.en.html.md.erb
where
en
stands for English. Adjust locale to the ISO two-letter code for
language. Example:
source/pages/os/documentation/howto-create-new-pages.en.html.md.erb
The weird extension chain ensures that middleman
will go through
Embedded ruby (erb), Markdown (md), HTML, and the translation engine
(en). The final extension will be .en.html
. You can edit in
Markdown, HTML5, and Embedded Ruby (erb). Normally Markdown will
suffice.
Running bundle exec middleman build
will generate the static HTML in
public/os/documentation/howto-create-new-pages.html
. Note that the
primary language does not appear in the path. If you’re building a
page in another language, say French, it will appear in
public/os/documentation/howto-create-new-pages.fr.html
.
We use the YAML front matter to set variables such as the page title, or its sibling pages. Please refer to existing pages for examples. Here is a list of common variables:
Variable | Value | Where? |
---|---|---|
title | Some Descriptive Title | All pages |
topic_id | number matching a topic in talk.devuan.org | pages with discussion |
prev | HTML link to previous page | /os (prev-next) |
up | HTML link to parent resource | /os (prev-next) |
next | HTML link to next page | /os (prev-next) |
You can also set your own variables or use data files in data/
.
Please refer to Middleman documentation.
Thank you for contributing!