Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Website update #199

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

[WIP] Website update #199

wants to merge 14 commits into from

Conversation

nurupo
Copy link
Member

@nurupo nurupo commented Apr 8, 2018

@robinlinden I need your help with this.

So, what we are doing here is adding blog in here and updating how the website works a little. Not that my initial commit looks totally broken and needs a some work to be done on it, which is what we are going to do here.

Both the blog and the website share the same pelicanconf.py file. I could make them separate, but @tox-user suggested showing a list of recent blog posts on the index page, which sounds like a good idea, which would be a bit hard to do if the website and blog were separate. In the future we can add separate pelicanconf-foo.py files for generating more of blog-like subsites, e.g. spec proposals, IRC meetings, etc.

Both the website and the blog use the global template located in themes/global, it defines the common look, which they then extend and modify, e.g. by adding title postfix like <title> - Tox blog or adding extra lines into <head></head> section.

Files in themes/website/templates get processed by Jinja and put into web root, preserving the directory structure.

Files in themes/blog/templates define Pelian blog theme, which pelican uses to generate the blog.

Files in content/website are markdown pages that get processed by themes/blog/templates/page.html template and put into the web root. The idea is that pages that are simple in formatting, like the About page, can be written in markdown rather than in html.

Files in content/blog are blog articles written in markdown.

My initial commit has a lot of test files that we will need to remove later, they are there just to see if multiple language support works, if directory structure gets preserved, etc. so don't mind some random files sprinkled here and there.


@robinlinden I need you to work on themes/blog to make the blog look good and have all relevant things in it's <head>, like rss/atom feed info, etc. The current blog templates are something I have thrown together to see how it works. Here are some references for you:

After that, you can look into getting about2.html, which is generated off markdown, to look like about.html, which is generated from html. The dark/light background alternation would probably hard to do, so we might want to make the background just light, like toktok.ltd does it, for all of our pages but index.

After you are done with that, you could add some language switcher to the website. Note that we can't use JavaScript for that.

Meanwhile I will be going through blog posts and cleaning them. They are imported from Wordpress and there is a little of weirdness going on in them, like non-breaking spaces, weird html tags and such.

I also need to figure out where to store files from blog posts, e.g. download files, photos from SCALE, etc. and how to link those properly across all website languages.

Then I need to setup i18n script for generating .po files and interfacing with Weblate so that we could translate Jinja templates.

@nurupo nurupo requested a review from robinlinden April 8, 2018 08:32
@nurupo
Copy link
Member Author

nurupo commented Apr 8, 2018

@robinlinden What about changing the author and category URLs from

AUTHORS_SAVE_AS = 'blog/authors/index.html'
AUTHOR_URL      = 'blog/author/{slug}/'
AUTHOR_SAVE_AS  = 'blog/author/{slug}/index.html'

CATEGORIES_SAVE_AS = 'blog/categories/index.html'
CATEGORY_URL       = 'blog/category/{slug}/'
CATEGORY_SAVE_AS   = 'blog/category/{slug}/index.html'

to

AUTHORS_SAVE_AS = 'blog/authors/index.html'
AUTHOR_URL      = 'blog/authors/{slug}/'
AUTHOR_SAVE_AS  = 'blog/authors/{slug}/index.html'

CATEGORIES_SAVE_AS = 'blog/categories/index.html'
CATEGORY_URL       = 'blog/categories/{slug}/'
CATEGORY_SAVE_AS   = 'blog/categories/{slug}/index.html'

?

That way a user could remove the top level from blog/categories/foobar and get a list of all categories, rather than HTTP 404 File Not Found.


Also, what about moving feeds from /blog/feeds/ into their corresponding directories, e.g. instead of the current

TRANSLATION_FEED_ATOM = 'blog/feeds/all-%s.atom.xml'
TRANSLATION_FEED_RSS = 'blog/feeds/all-%s.rss.xml'
CATEGORY_FEED_ATOM = 'blog/feeds/category/%s.atom.xml'
CATEGORY_FEED_RSS = 'blog/feeds/category/%s.rss.xml'
AUTHOR_FEED_ATOM = 'blog/feeds/author/%s.atom.xml'
AUTHOR_FEED_RSS = 'blog/feeds/author/%s.rss.xml'

do

TRANSLATION_FEED_ATOM = 'blog/feed.atom.xml'
TRANSLATION_FEED_RSS = 'blog/feed.rss.xml'
CATEGORY_FEED_ATOM = 'blog/categories/%s/feed.atom.xml'
CATEGORY_FEED_RSS = 'blog/categories/%s/feed.rss.xml'
AUTHOR_FEED_ATOM = 'blog/authors/%s/feed.atom.xml'
AUTHOR_FEED_RSS = 'blog/authors/%s/feed.rss.xml'

?

@SkyzohKey
Copy link
Contributor

I still dont understand why you don't like JS. The ''noscript users are fucked with js website'' is no more relevant thanks to SSR. Basically you run the js server side and return the result as plain HTML/CSS stuff. So that no script users have functional website while js browsers get extra shiny stuff that makes the user experience more pleasant.

I'd like to help with your PR if you need some code help, or review, or anything. Feel free to tell me what to do.

@tox-user
Copy link
Contributor

tox-user commented Apr 8, 2018

@SkyzohKey
There will be no server anymore. The website will be moved to Github. A lot of it won't even use HTML.

@robinlinden
Copy link
Member

@nurupo I like always being able to go up one level on the website without hitting a 404, so I think it's a good idea to always use categories and authors.

I also like the idea of putting the feed files together with the content you'll get a feed for.

@SkyzohKey
Copy link
Contributor

SkyzohKey commented Apr 8, 2018

@tox-user what the point? Saving 8$/month ?

Letting Tox's website security/hosting be handled by Github is stupid. Github is closed source and has already censored repositories.

Tox SHOULD NEVER relies on a closed source third party service to host it's only information' platform.

@tox-user
Copy link
Contributor

tox-user commented Apr 8, 2018

@SkyzohKey that's not all though. @nurupo has told me that Github doesn't support https for custom domains, so the website would have to use Cloudflare. Cloudflare is a man in the middle, which allows them so access all information in clear text and replace the contents of the website. I am very concerned about this too. I think it's all going in a very wrong direction. If Github is really known for censorship, then we would have another reason to worry. I'm not entirely sure about the reasons for doing this, so I hope @nurupo could explain them here. If the reason is money, maybe we should focus on getting funding TokTok/c-toxcore#738.

@nurupo
Copy link
Member Author

nurupo commented Apr 9, 2018

@SkyzohKey this PR is mostly for me collaborating with @robinlinden, it would be nice if you could take discussion of your website somewhere else please.

@nurupo
Copy link
Member Author

nurupo commented Apr 9, 2018

@tox-user also, this PR doesn't have much to do with the website moving to GitHub and we haven't decided on if it's something we would do yet. What this PR does is moving away from using Wordpress for the blog, making blog use the same design the website does and adding support of multiple languages to the website. The things you are talking about are out of scope of this PR, so please take them elsewhere.

@sudden6
Copy link
Contributor

sudden6 commented Apr 20, 2018

I agree with all the no JS people, it's a pretty static website that changes at max once a day, I see no need for bloating it with JS. Small websites are also more accessible to users with unstable internet connections and TOR users.

@SkyzohKey
Copy link
Contributor

sudden6: what if you can have best of the both worlds? Static rendering via SSR (Server Si de Rendering) & then JS enabled features for JS usées while the website is fully working without it. Also, more people can contribute with JS than Pélican..

@nurupo
Copy link
Member Author

nurupo commented Apr 21, 2018

Alright guys, didn't I ask to take the offtopic discussions somewhere else? How many times do I have to ask this? There is an entire issue dedicated to discussing @SkyzohKey's redesign -- #197, stop using this PR for discussing it. Don't be surprised if your offtopic comments start being deleted from this thread.

nurupo added 3 commits May 2, 2018 07:54
The plugin is changing summary's HTML in an unexpected way, breaking
internal content linking functionality. Article HTML is not a valid
HTML, we have some URL starting with '{filename}', whcih Pelican is
supposed substitute with the right path somewhere down the processing
pipeline, but the plugin is run before that substitution takes place,
it uses libxml to modify the HTML, libxml freaks out about '{filename}'
as '{' and '}' are not allowed characters, and ends up escaping them, or
so it seems, which in turn means that Pelican wouldn't do the
substitution and we will end up with '{filename}' URLs in the output.

This plugin has caused quite some issues in the past, it brings in
libxml dependency and making it undo libxml's escaping of exactly
'{filename}' feels like a dirty hack, because next time we might want
to use '{foo}' and will face this same problem again, so I don't think
this plugin is worth keeping. Not to mention that we don't really need
this plugin in the first place, we can make a Read More link without it.
Also, this plugin makes the Read More link be a part of the summary
text, which is undesired since the summary is used to generate the feeds
and our Read More would seem very out of place in there, the feeds
likely put their own Read More in there, so it would be a double Read
More, and reading more twice is not reading more anymore, it's reading
much, too much in fact, assuming you read the whole article twice.
@Tox Tox deleted a comment from redmanmale May 7, 2018
@nurupo
Copy link
Member Author

nurupo commented May 10, 2018

I'm done for now, waiting on @robinlinden to do his part. The only thing that I have left to do is setting up a project on Weblate's website and scripts for uploading/downloading translations to/from it, which is better to do once we get all templates sorted out.

@sudden6
Copy link
Contributor

sudden6 commented May 10, 2018

qTox has already a script to download stuff from weblate, maybe you can take it as a template: https://github.com/qTox/qTox/blob/master/tools/update-weblate.sh

@nurupo
Copy link
Member Author

nurupo commented Jul 17, 2018

@robinlinden that's how I build the website inside a docker container to replicate the target system. I use python3 since python2 would soon be deprecated. Note that the target system, Debian Stretch, has python 3.5.

sudo docker run -it --rm debian:stretch-slim /bin/bash
apt-get update
apt-get install -y --no-install-recommends git-core make virtualenv
cd ~
git clone https://github.com/nurupo/tox.chat
cd tox.chat
git checkout website-update
virtualenv -p /usr/bin/python3 env
source env/bin/activate
pip install -r requirements.txt
make html DEBUG=1

@nurupo
Copy link
Member Author

nurupo commented Aug 11, 2019

Well, it's probably obvious now, but just a FYI that I'm not actively working on this, I don't have much time to work on this (well, haven't had since mid-2018). I'm hoping to come back working on this sometime later so I'm keeping the PR open, though with tox development becoming less and less active in the last 12-18 months, it makes me question if it's really worth spending my time on this website update, which makes me prioritize working on my other projects over working on this PR, which just adds up to the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants