As of today, PieFed includes a ‘theme engine’ which makes it easier for people with low or no Python skills to change how PieFed looks and behaves.
Let’s start with the app/templates/themes directory in the PieFed codebase. In this directory there will be a sub-directory for each theme that is available. As of this writing there is only one, called ‘high_contrast’. If you want to make a new theme, copy the high_contrast directory and rename the copy to something 20 characters or less. Let’s pretend your theme is called ‘my_theme’.
Inside ‘high_contrast’ is high_contrast.json. This file contains a bit of information about the theme, to improve the user experience of choosing which theme to enable. Currently the only information in there is a user-friendly name for our theme but I might add more in future. In our new theme we to rename high_contrast.json to be the same as the directory containing it, or ‘my_theme.json’ in this case. Also change the user friendly name in the JSON to something like “My Theme”. Take care not to change the double quotes.
Also in the theme directory are two files: styles.css and scripts.js. You can remove the high_contrast CSS and put your own. high_contrast’s scripts.js is empty and is just a placeholder to encourage you to add your own JavaScript.
In PieFed on the main menu, go to Account -> Settings and check if your new theme is shown as an option in the Theme field. If not then you messed up the naming of the theme directory or theme.json file. The theme setting here will change the theme you use while browsing PieFed – to change it for everyone go to Admin -> Misc Settings and set the ‘Default theme’ option.
Editing styles.css and scripts.js will probably be enough for most people. But in addition to that you can copy any .html file from app/templates into your theme and that copy will be used instead of the default one. For example, the home page template is app/templates/index.html so if you copied it to app/templates/themes/my_theme/index.html then any edits you make to the copy will be used to render the home page in a different way than the stock PieFed theme would!
If you want to theme a template in a sub-directory, like app/templates/post/post.html then the correct place for your copy will be app/templates/themes/my_theme/post/post.html.
The .html templates are a mixture of HTML and a language similar to Python called Jinja2.
I very much look forward to seeing what people come up with!
Licensing
PieFed is licensed under the open source AGPL license and themes are considered derivative works. As a result, themes need to be licensed under the AGPL as well.
This means that anyone who distributes or shares their PieFed themes must do so under the terms of the AGPL, ensuring that the source code of the theme remains open and accessible to others. If you do not distribute or share the theme with others then you do not need to share the source code with the public.
Using the theme to serve a publicly-accessible PieFed instance is “distribution” so you need to be able to make the theme source code available to everyone, either as a downloadable file or a git repository. If you choose to send PieFed a PR of your theme it will be gratefully accepted.
@wagtail its a great idea as it would make potentially any django / wagtail installation a first class citizen of the fediverse, expanding functionality in various novel ways
There are already several django based activitypub servers (I am aware of #funkwhale, #takahẽ , #socialhome) and related #python projects (#bovine, #piefed) but it seems there is zero code re-use among them.
It is still early enough in the #redditmigration that #lemmy or #kbin can easily be replaced if something superior comes along. So if #piefed or #sublinks can develop their consumer facing products better and faster then they will inevitably get the community support. And since sublinks uses the existing Lemmy API it might have the best chance to do so.
You never know, the current Lemmy devs might be pushed aside tomorrow, anything could happen.
It’s crazy how much of the comments about #Subllinks on the threadiverse are mad that the author is using #Java or just complaining that they chose to build another implementation.
Most of it seems to be #Lemmy users who think that #kbin, #mbin, #piefed, etc don’t exist and no other federated link aggregator should exist.
Very often when encountering an open source codebase you are left on your own to figure it out. Documentation is often limited to installation / compilation instructions.
With the following video I am trying to ease the onboarding process for new developers. I assume you already know Python, HTML and CSS. I start with a brief introduction to Flask and then move on to how forms work, routes, database interaction, frontend, background tasks and more.
This video will compliment the written documentation (still to come – very soon!).
There are quite a few communities that are entirely image posts so presenting them as a vertical list of thumbnails doesn’t really make the best of what is there.
To improve on that I’ve made use of the common web design pattern called ‘masonry’, where the images are arraigned like bricks in a wall. Check it out:
On each tile there is the title of the post at the bottom which can be clicked on to view the post and it’s comments. This footer area could be improved with voting buttons and perhaps the number of comments, in future.
This doesn’t work as well for meme communities as memes often contain a lot of text, which gets squished. Perhaps there needs to be a 2 or 3 column version with larger thumbnails.
The PieFed chatroom can be used to discuss ideas, fix server issues or shoot the breeze. Also check out the ActivityPub Community on Matrix, for discussions about other fediverse software.
Awesome. You could follow/join the PieFed meta community although as you say posts there are likely to be lost in the flood of other posts. You could follow me on on Mastodon where I pretty much exclusively post about this project - @rimu. Or pop your email address into the form at https://rimu.geek.nz/piefed-comms/?p=subscribe or join the matrix room at https://matrix.to/#/#piefed-community:matrix.org
"Care has been taken to construct it in the simplest way possible, enabling contributions from programmers of all skill levels and keeping server costs down. This will greatly speed PieFed's development process and widen its adoption."
Clever move by @rimu Lemmy's development is struggling.
The most popular instance, lemmy.world (>25% monthly active users), is still on a previous release. The current release, 0.19.1, has broken federation for the past couple weeks. Up-to-date instances are hobbling along by being restarted every few hours.
Tried hacking on Lemmy myself... I've got many thoughts but not sure if/how to write them down.
There needs to be consequences for getting lots of downvotes.
One of those could be something like this, where everyone can see that you get downvoted a lot and decide whether and how to engage with you in future.
There will be bugs, probably many bugs. When you see one, please reply to the welcome email you received, with info about it, or report it in the issue queue. Let’s catch ’em all!
#Python developers are invited to check out the code repository at https://codeberg.org/rimu/pyfedi. In coming days I’ll write better setup instructions and put together a code walk-through screencast.
Quite happy with the speed of the background task that ingests #ActivityPub data sent to #PieFed from other servers. Most Activitys are processed in around 0.1 seconds, average of 0.22 seconds, or ~5 per second. This is with just one worker process.
If a 4 core VPS can handle 6(?) worker processes/threads it'll do 6 * 5 = 30 per sec.
@javi I've been using ngrok.com, which makes it very easy to temporarily give something running locally a domain name that anyone from outside (including other servers, obvs) can use to access your site/app and send Activitys.
e.g. https://piefed.ngrok.app is running off the laptop in my office. Any code edits immediately take effect and I can watch errors scroll by in my IDE in real time, set breakpoints, etc. Very effective.
Made a little #ActivityPub log for #PieFed so I can spot anomalies and review data coming in and out of my dev instance.
After a few weeks of testing federation in canned scenarios, PieFed is now interacting with actual instances on the 'real' #fediverse, so all sorts of unexpected things are happening! Performance, timing issues, invalid requests, unresponsive servers, all that fun stuff.
Maybe don't call people [by a label which designates membership in a more powerful, dominant group whose lives are treated as the baseline "norm" and who happen to have far greater power to impose and enforce oppressive social norms in a heavily socially stratified society]?
Does PieFed work with client apps like Memmy?
I'm trying to add my PieFed account to Memmy (an iOS Lemmy client). I was able to add my midwest.social account as expected....
Fediverse link-aggregator PieFed launches in beta test (fediversereport.com)
We now have another thread aggregator to join Lemmy and Kbin on the fediverse!...