Compare commits

...

153 commits
v0.6 ... master

Author SHA1 Message Date
Marcel Kapfer 36bef95804
Updated README 2018-01-04 00:50:36 +01:00
Marcel Kapfer 49cc36a5c8
Added feature graphic. 2018-01-04 00:36:51 +01:00
Marcel Kapfer 776789da6c Merge branch 'stable' of gitlab.com:mmk2410/rangitaki 2017-05-20 21:03:30 +02:00
Marcel Kapfer 9665f098db README: add Gitter chatroom badge 2017-05-20 21:01:42 +02:00
Marcel Kapfer (mmk2410) b775ab99eb Added tests for BlogListGenerator 2016-12-30 00:05:40 +01:00
Marcel Kapfer (mmk2410) 00d3149360 Hide url blogs from selection field in the rcc 2016-12-30 00:05:01 +01:00
Marcel Kapfer (mmk2410) 623395064f composer update 2016-12-30 00:04:12 +01:00
Marcel Kapfer (mmk2410) 9ac51e0523 Improved testability of BlogListGenerator 2016-12-29 21:59:55 +01:00
Marcel Kapfer (mmk2410) 89e756819d Made BlogListGenerator PSR-2 conform 2016-12-29 21:54:37 +01:00
Marcel Kapfer (mmk2410) 0bb2dede4d Nav item with link to external page 2016-12-29 09:40:35 +01:00
Marcel Kapfer (mmk2410) 65263d4ca0 Added emacs files to gitignore 2016-12-29 09:39:59 +01:00
Marcel Kapfer (mmk2410) 161cfc3187 Merge branch 'release-1.5.0' into stable 2016-08-03 18:34:51 +02:00
Marcel Kapfer (mmk2410) 72bbd8d046 Version bump to 1.5.0 2016-08-03 18:32:40 +02:00
Marcel Kapfer (mmk2410) 92451f15ea Update Script for 1.5.0 2016-08-03 18:29:16 +02:00
Marcel Kapfer (mmk2410) c1a7ede3bc Better code style 2016-08-03 17:19:59 +02:00
Marcel Kapfer (mmk2410) 1aa4b42c0c Prevented a few error logs 2016-08-03 17:16:58 +02:00
Marcel Kapfer (mmk2410) 54132c7218 added excerpt feature to config script 2016-08-03 16:38:50 +02:00
Marcel Kapfer (mmk2410) b439cf27d7 removed nearly useless debug script 2016-08-03 16:33:01 +02:00
Marcel Kapfer (mmk2410) bbdacffc7d Excerpt feature. https://phab.mmk2410.org/T121
Res T121
2016-08-02 19:53:08 +02:00
Marcel Kapfer (mmk2410) 72e11c425e theme recompile 2016-08-02 19:50:54 +02:00
Marcel Kapfer 34e9dd31e4 Merge branch 'correct-meta-tags' into 'master'
correct meta tags

Correct https://gitlab.com/mmk2410/rangitaki/merge_requests/2 

See merge request !3
2016-07-17 09:58:13 +00:00
Stefan 4aeb468fe1 correct meta tags 2016-07-17 08:42:46 +02:00
Marcel Kapfer (mmk2410) e6245524a4 better code style for ArticleGenerator::getArray 2016-06-06 22:22:16 +02:00
Marcel Kapfer (mmk2410) 17e4e5570e "temporary" fix for ArticleGenerator::getSummary 2016-06-06 22:21:38 +02:00
Marcel Kapfer (mmk2410) ad2ff5236b unit test for ArticleGenerator 2016-06-06 22:19:49 +02:00
Marcel Kapfer (mmk2410) 67186f6910 Unit test for Config.php 2016-06-05 22:37:05 +02:00
Marcel Kapfer (mmk2410) 25f1ff3188 still trying to make gitlab ci work 2016-06-04 16:46:36 +02:00
Marcel Kapfer (mmk2410) 6b7bf70ec1 Fixed .gitlab-ci.yml 2016-06-04 10:13:01 +02:00
Marcel Kapfer (mmk2410) 8dc9b50d38 Fixed .gitlab-ci.yml 2016-06-04 10:10:50 +02:00
Marcel Kapfer (mmk2410) cc053c88a1 Fixed .gitlab-ci.yml 2016-06-04 10:07:35 +02:00
Marcel Kapfer (mmk2410) d01570a451 Fixed .gitlab-ci.yml 2016-06-04 10:06:15 +02:00
Marcel Kapfer (mmk2410) 92166b921e Add .gitlab-ci.yml 2016-06-04 10:00:38 +02:00
Marcel Kapfer (mmk2410) 03a24c883b tests 2016-06-04 09:59:11 +02:00
Marcel Kapfer (mmk2410) f938e60c2e Merge branch 'master' of gitlab.com:mmk2410/rangitaki 2016-06-04 09:46:34 +02:00
Marcel Kapfer (mmk2410) 7532af8a80 init script for debugging 2016-06-04 09:45:59 +02:00
Marcel Kapfer (mmk2410) c20c0b4ff9 Merge branch 'stable' of gitlab.com:mmk2410/rangitaki into stable 2016-06-03 16:46:31 +02:00
Marcel Kapfer (mmk2410) 1d79aa4c21 Merge branch 'release-1.4.4' into stable 2016-06-03 16:45:54 +02:00
Marcel Kapfer (mmk2410) 39f022d2dd Version bump to 1.4.4 2016-06-03 16:41:53 +02:00
Marcel Kapfer (mmk2410) e994eb074a Update Script for 1.4.4 2016-06-03 16:39:47 +02:00
Marcel Kapfer (mmk2410) f1cfc0c08c feed: Switched to new PicoFeed implementation 2016-06-03 15:31:37 +02:00
Marcel Kapfer (mmk2410) 6d1a7c7e09 feed: New dependencies, YAML config 2016-06-03 15:30:41 +02:00
Marcel Kapfer (mmk2410) 9fa47ecfd5 Updated copyright text 2016-06-03 15:28:02 +02:00
Marcel Kapfer (mmk2410) 0baffcc5cf Check first if value exists 2016-06-03 15:25:59 +02:00
Marcel Kapfer (mmk2410) 352095a6d2 Fixed .gitignore to prevent hiding the rcc/feed directory.
Ref T118
2016-06-03 15:20:09 +02:00
Marcel Kapfer (mmk2410) 6c9aa05cbb Merge branch 'release-1.4.3' into stable 2016-05-21 21:22:49 +02:00
Marcel Kapfer (mmk2410) 7210e8e1e1 Version bump to 1.4.3 2016-05-21 21:20:47 +02:00
Marcel Kapfer (mmk2410) 8eab76ed20 Update script for version 1.4.3: fixes 2016-05-21 21:20:00 +02:00
Marcel Kapfer (mmk2410) 780db2ae07 Update script for version 1.4.3 2016-05-21 21:06:13 +02:00
Marcel Kapfer (mmk2410) 0c080a2237 Updated texts 2016-05-21 19:57:36 +02:00
Marcel Kapfer (mmk2410) fcb64f23eb nextDESIGN added to delivered themes 2016-05-21 19:51:56 +02:00
Marcel Kapfer (mmk2410) f497b7b87b [FIX] Background layer not removed if drawer closes 2016-05-21 19:49:33 +02:00
Marcel Kapfer (mmk2410) bdc617ffef [FIX] Missing space in drawer between "Blogs on" and blogname. 2016-05-21 19:46:33 +02:00
Marcel Kapfer (mmk2410) e05dc0b173 Merge branch 'release-1.4.2' into stable 2016-05-18 14:52:30 +02:00
Marcel Kapfer (mmk2410) a6019319a2 Version bump 1.4.2 2016-05-18 14:51:13 +02:00
Marcel Kapfer (mmk2410) 71f67d506e Update Script for 1.4.2 2016-05-18 14:47:51 +02:00
Marcel Kapfer (mmk2410) b67c9b3415 FIX: Password verification not implemented in RCC login page 2016-05-18 14:46:10 +02:00
Marcel Kapfer (mmk2410) e059544e90 Merge branch 'release-1.4.1' into stable 2016-05-18 13:37:42 +02:00
Marcel Kapfer (mmk2410) 3a8494417e Version bump to 1.4.1 2016-05-18 13:33:28 +02:00
Marcel Kapfer (mmk2410) d33ff8f984 Update script for 1.4.1 2016-05-18 13:32:44 +02:00
Marcel Kapfer (mmk2410) 007aea9b10 FIX: Missing nodejs dependencies 2016-05-18 07:39:41 +02:00
Marcel Kapfer (mmk2410) 52835db8db FIX: Go Back didn't work 2016-05-18 07:38:40 +02:00
Marcel Kapfer (mmk2410) fb937319db Store password as hash
Resolves T117
2016-05-17 22:37:36 +02:00
Marcel Kapfer (mmk2410) 5e45579ef1 Switch to HTTP Basic Auth
Resolves T115
2016-05-17 22:36:26 +02:00
Marcel Kapfer (mmk2410) 42f1992c97 Require SSL for the RCC.
Resolves T116
2016-05-17 22:34:33 +02:00
Marcel Kapfer (mmk2410) 655b982f9d FIX: Missing nodejs dependencies 2016-05-17 20:59:54 +02:00
Marcel Kapfer (mmk2410) 1b0c92bb31 FIX: Disqus not migrated to new config 2016-05-17 20:58:50 +02:00
Marcel Kapfer (mmk2410) e2d8082c1f Merge branch 'release-1.4.0' into stable 2016-05-07 17:43:03 +02:00
Marcel Kapfer (mmk2410) 23617b21bc Version bump to 1.4.0 2016-05-07 17:41:31 +02:00
Marcel Kapfer (mmk2410) 41c273b962 update script for 1.4.0 2016-05-07 17:32:30 +02:00
Marcel Kapfer (mmk2410) 60b094d5fa add composer's vendor directory 2016-05-07 12:59:40 +02:00
Marcel Kapfer (mmk2410) 01a3860d73 Merged CHANGELOG.txt and CHANGELOG.md 2016-05-03 17:35:42 +02:00
Marcel Kapfer (mmk2410) 999998b60b Version Bump to 1.4.0-beta 2016-04-27 12:54:04 +02:00
Marcel Kapfer (mmk2410) 474efd25f3 npm, Gulp, Minimize
Resolves T30, T29
2016-04-26 20:24:17 +02:00
Marcel Kapfer (mmk2410) bc694dc6a0 CSS themes converted in SASS
Ref T30
2016-04-26 19:35:46 +02:00
Marcel Kapfer (mmk2410) 8330a1ce98 CSS rewritten in SASS
Ref T30
2016-04-26 19:09:39 +02:00
Marcel Kapfer (mmk2410) e10db31a00 Example JavaScript extension rewritten in CoffeeScript
Ref T30
2016-04-26 17:57:39 +02:00
Marcel Kapfer (mmk2410) d50341259d Rewritten app.js in CoffeeScript
Ref T30
2016-04-25 20:33:00 +02:00
Marcel Kapfer (mmk2410) 432b8d307a Open article link in a new tab
Fixes T34
2016-04-25 18:47:02 +02:00
Marcel Kapfer (mmk2410) 5d051c1b0e init script 2016-04-23 15:27:11 +02:00
Marcel Kapfer (mmk2410) 319d3d6138 Pagination fix 2016-04-23 15:26:35 +02:00
Marcel Kapfer (mmk2410) 297cf418c0 Better code style 2016-04-22 19:46:46 +02:00
Marcel Kapfer (mmk2410) ac65f5ee70 Config switch to YAML 2016-04-22 19:28:27 +02:00
Marcel Kapfer (mmk2410) edca0cc8cc removed obsolete config.php 2016-04-22 18:50:07 +02:00
Marcel Kapfer (mmk2410) 9773669684 Config switch script 2016-04-22 18:49:14 +02:00
Marcel Kapfer (mmk2410) f632bf2de5 Remove Debug Outputs 2016-04-22 18:20:40 +02:00
Marcel Kapfer (mmk2410) e0dc2622c2 API auth 2016-04-22 18:18:21 +02:00
Marcel Kapfer (mmk2410) 39da838ebd RCC init script 2016-04-21 09:56:53 +02:00
Marcel Kapfer (mmk2410) d82f8e8011 Config class: write yaml file 2016-04-21 09:46:45 +02:00
Marcel Kapfer (mmk2410) 4e91eeb3ab API: Auth implementation 2016-04-18 17:30:12 +02:00
Marcel Kapfer (mmk2410) 01a6fb914f API: Media files 2016-04-18 11:04:41 +02:00
Marcel Kapfer (mmk2410) 339e2eee36 Composer: codeguy/Upload 2016-04-18 11:04:26 +02:00
Marcel Kapfer (mmk2410) 2c4ce6cb50 API: List 2016-04-18 09:57:11 +02:00
Marcel Kapfer (mmk2410) 9947a5f033 Cleanup 2016-04-18 09:56:52 +02:00
Marcel Kapfer (mmk2410) cb491341df Better code with isset() 2016-04-18 09:53:47 +02:00
Marcel Kapfer (mmk2410) 6d1928da70 YAML Config Implement and post api 2016-04-17 17:00:18 +02:00
Marcel Kapfer (mmk2410) 331465857c README.md update 2016-04-17 10:45:57 +02:00
mmk2410 e9c09311fe Fix: Feeds didn't show article content 2016-03-12 10:28:46 +01:00
mmk2410 681f4c3c83 Fix; Problem inserting password after instering wrong password 2016-03-11 18:58:26 +01:00
mmk2410 75b705ee2c Code Improvements 2016-03-11 18:54:58 +01:00
mmk2410 08ee5eaf39 Update script fix 2016-02-16 17:21:41 +01:00
Marcel Kapfer (mmk2410) 078237c7ec Update Readme
Update readme for Rangitaki version 1.3.
2016-02-16 15:11:25 +01:00
mmk2410 05d583f17f Changelog 2016-02-16 14:54:07 +01:00
mmk2410 fda6e3d811 Switch to Composer 2016-02-16 14:19:57 +01:00
mmk2410 ce709fec80 Atom feed 2016-02-16 14:19:17 +01:00
mmk2410 5d041ff6f8 Do-not-track 2016-02-16 14:16:20 +01:00
mmk2410 bd28332252 Update Script for 1.3.0 2016-02-16 14:15:56 +01:00
mmk2410 c9279b8f1d File imporvements 2016-02-16 14:15:21 +01:00
mmk2410 da3916bb99 README update 2016-01-11 19:41:54 +01:00
mmk2410 ee86c8cdd5 Update Script 1.2.0 to 1.2.1 2016-01-11 19:39:58 +01:00
mmk2410 c68179d83e Updated Parsedown -> Support for PHP 7.0 2016-01-11 19:24:51 +01:00
Marcel Kapfer (mmk2410) 1a08ae769b Updated README.md 2015-12-24 17:29:56 +01:00
Marcel Kapfer (mmk2410) 95a28acb6a Update scripts 2015-12-24 17:27:24 +01:00
Marcel Kapfer (mmk2410) b2d723cb62 No error if no extensions dir 2015-12-24 12:13:33 +01:00
mmk2410 dc515eab7a Update script 1.1.2 to 1.1.90 2015-12-21 19:48:27 +01:00
mmk2410 0a9f5a9f30 Merge branch 'master' of github.com:mmk2410/rangitaki 2015-12-21 15:57:22 +01:00
mmk2410 2586db7a6f Localization of Pagination 2015-12-21 15:56:18 +01:00
mmk2410 23f9765b3a BUGFIX: Error when no tags set 2015-12-21 15:53:10 +01:00
mmk2410 a1d9e971e3 BUGFIX: Update Script 2015-12-21 15:52:16 +01:00
Marcel Kapfer (mmk2410) bc626fa918 Update README 2015-12-20 21:37:12 +01:00
mmk2410 a9a9886450 Update script improvements 2015-12-20 21:22:01 +01:00
mmk2410 6271448248 Update script for 1.1.2 2015-12-20 21:11:50 +01:00
mmk2410 2fdfa5e232 Default settings restored 2015-12-20 19:19:41 +01:00
mmk2410 7eb917f115 Pagination and Code Style improovements 2015-12-20 17:50:22 +01:00
mmk2410 a880398ee3 Better Code Style 2015-12-18 21:59:34 +01:00
mmk2410 b3802a8994 rangitaki in lowercase 2015-12-07 15:56:55 +01:00
mmk2410 d8461432be Update Script for 1.1.1 2015-12-07 15:02:26 +01:00
mmk2410 6e6e26ad26 Delete Posts
Edit Posts
Back to blog
2015-12-06 15:19:16 +01:00
mmk2410 fbca74ccec Back to blog from RCC 2015-12-05 18:30:51 +01:00
mmk2410 fe2e50b3b6 JavaScript extension support 2015-12-05 18:21:22 +01:00
mmk2410 ac67c0fae1 Code CSS before Theme style sheet 2015-12-05 18:08:24 +01:00
mmk2410 7ebcd0aca1 BUGFIX: RCC: New Post: Filename without time 2015-11-23 15:51:24 +01:00
mmk2410 4be3b056c3 BUGFIX: RCC: new post: title is blog name 2015-11-22 19:37:18 +01:00
mmk2410 9343b9a115 update script 2015-11-22 18:31:14 +01:00
mmk2410 fe81cb784e Update script 2015-11-22 18:19:22 +01:00
mmk2410 c242062cd9 Various Improvements:
- Metatags based on subblog and/or article
 - Drawer close button
 - RCC: media upload
 - RCC subpages: back button
2015-11-22 00:59:07 +01:00
mmk2410 c910225e7d Navigation drawer key handling
Drawer opens on 'm' and closes on 'Esc'
2015-11-18 15:48:44 +01:00
mmk2410 352182ae10 Nav: Blogs highlighted when hovering 2015-11-18 15:18:18 +01:00
mmk2410 c3c863b446 BUGFIX: Drawer not completly closed 2015-11-18 15:01:39 +01:00
mmk2410 e8a2557c4a RCC: Write blog posts online 2015-11-17 22:46:20 +01:00
Marcel Kapfer 5568943994 Update README.md 2015-08-22 10:48:39 +02:00
mmk2410 30f64e386d Updated README.md 2015-08-22 10:29:05 +02:00
mmk2410 f40a680877 Updated README.md 2015-08-22 10:27:51 +02:00
mmk2410 c703df1deb Switch to files named "example.*" 2015-08-22 09:14:55 +02:00
mmk2410 f58b17f585 UXFIX: Headline now colored on mouseover 2015-08-22 09:11:50 +02:00
mmk2410 1922a1a697 BUGFIX: Intro shown, when there's no content 2015-08-22 08:59:50 +02:00
Marcel Kapfer 4b52d81282 Update README.md 2015-08-13 23:26:47 +02:00
mmk2410 9973ea84e4 Version 0.9: Code comments, bug fixes, three new test files 2015-07-25 09:34:51 +02:00
mmk2410 42404cd9d7 Rangitaki 0.8 2015-07-14 22:16:17 +02:00
mmk2410 34a8798b95 Rangitaki 0.8 2015-07-14 22:10:16 +02:00
mmk2410 f996fbc1db Updated README 2015-07-05 19:15:58 +02:00
mmk2410 f25ccc1696 Semicolon fix... 2015-07-05 18:18:24 +02:00
mmk2410 85f2197b91 Localization; Add German 2015-07-05 18:05:56 +02:00
mmk2410 b6e719b6c6 Twitter and OpenGraph meta tags; favicon 2015-07-05 18:02:19 +02:00
763 changed files with 48835 additions and 1537 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
nbproject/
*~

11
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,11 @@
image: php:7.0
before_script:
- bash ci/docker_install.sh > /dev/null
stages:
- test
test:
script:
- phpunit tests/

191
CHANGELOG.md Normal file
View file

@ -0,0 +1,191 @@
# Changelog
- [S] = stable release
- [B] = beta release
- [D] = development release
- [S] release are always compared to the previous [S] release.
## Version 1.5.0 (2016-08-03) [S]
- **[FEATURE]** Ability to only show post excerpts on overview pages
- **[FIX]** Fixed twitter username not specified in connfig.yaml
- **[FIX]** Fixed wrong OpenGraph meta tags
- **[CODE]** Further improved code style
- **[CODE]** Added unit tests for Config.php and ArticleGenerator.php
- **[NOTE]** If you have own language file, please update them. See also the upgrade guide
## Version 1.4.4 (2016-06-03) [S]
- **[FIX]** Error when trying to create a feed
## Version 1.4.3 (2016-05-21) [S]
- **[FIX]** Missing space in drawer between "Blogs on" and blogname
- **[FIX]** Background layer was not removed if drawer was closed
- **[FEATURE]** nextDESIGN theme added to delivered themes
- **[NOTE]** The update script to 1.4.3 works with 1.4.0, 1.4.1 and 1.4.2
## Version 1.4.2 (2016-05-18) [S]
- [FIX]: Password verification not implemented in RCC login page
## Version 1.4.1 (2016-05-18) [S]
- Switch to HTTP Basic Auth for the RCC API
- Store password as hash
- Require SSL for using the RCC and the RCC API
- [FIX] Drawer "Go back" does not work
- [FIX] Missing nodejs dependencies
- [FIX] Disqus not completly migrated to new config
## Version 1.4.0 (2016-05-07) [S]
- Fix: Feeds contain no text
- Switch to YAML as config language
- Scripts for
- Switching from config.php to config.yaml
- Initializing RCC
- Initializing Rangitaki
- Rangitaki API
- Switch from JavaScript to CoffeeScript
- Switch from CSS to SASS
- Building and minimizing with Gulp
- Open links in articles in a new tab
- Better code style: PSR-2
## Version 1.4.0-beta (2016-04-27) [B]
- Fix: Feeds contain no text
- Switch to YAML as config language
- Scripts for
- Switching from config.php to config.yaml
- Initializing RCC
- Initializing Rangitaki
- Rangitaki API
- Switch from JavaScript to CoffeeScript
- Switch from CSS to SASS
- Building and minimizing with Gulp
- Open links in articles in a new tab
- Better code style: PSR-2
## Version 1.3.0 (2016-02-16) [S]
- Respecting do-not-track
- Atom feed
- Title fix
- Switch to composer
## Version 1.2.1 (2016-01-11) [S]
- Support for PHP 7
## Version 1.2.0 (2015-12-24) [S]
- Pagination: Split your blog posts over several page
- JavaScript Extension Support
- RCC: Write Posts
- RCC: Delete Posts
- RCC: Upload Media
- RCC: Edit Posts
## Version 1.1.90 (2015-12-21) [B]
- BUGFIX: ArticleGenerator error when no tags set
- Pagination: Localized strings
## Version 1.1.2 (2015-12-20) [D]
- Pagination
- Code style imporvements
## Version 1.1.1 (2015-12-07) [D]
- BUGFIX: RCC: new post: post title was the blog title
- BUGFIX: RCC: new post filename just the date without the time.
- Code highlight css themable
- JavaScript extension support. Just put your extension into ./extensions/
- Link in RCC to go directly to the blog
- RCC: Delete posts
- RCC: Edit posts
## Version 1.1.0 (2015-11-22) [D]
- RCC: Write blog posts
- RCC: Media Upload
- Drawer: Key listener ('ESC' to close, 'm; to open)
- Drawer: Highlight Blogs when hovering
- Drawer: 'X' button
- Metatags / Title based on subblog and / or article
- Update script
## Version 1.0.0 (2015-08-22) [S]
- Post writing in Markdown with a few keywords for the title, tags, date and the author (all optional)
- Multiple blogs
- A Subpages for each article with a comment box (Disqus; can be disabled)
- Share buttons (FAB; can be disabled)
- Disqus integration (can be disabled)
- Fast and easy configuration
- Google Analytics (optional)
- Twitter and OpenGraph meta tags
- Different themes
- Easy localization (just 3 (!) strings)
- Custom footer
- Navigation drawer (can be disabled)
- Tags
- Set author and date
- Mobile-first
- Rangitaki Control Center (aka RCC; optional, Read the RCC Documentation)
- Online post upload
## Version 0.9.0 (2015-07-25) [B]
- BUGFIX: 'Blogs of {BLOG NAME}' always shown (even if there are no other blogs)
- pictures in articles not centred
- long links longer than article card (especially a problem on mobile devices)
- Localization strings are now grouped in one array
- Better code (in some parts)
## Version 0.8.0 (2015-07-14) [B]
- Bugfixes and other improvements
## Version 0.7.0 (2015-07-05) [D]
## Version 0.6.0 (2015-07-03) [D]
- Localization support. More information will follow soon
- Theme support. More information will follow (hopefully) soon
- Various improvements (Check the commits for more)
## Version 0.5.0 (2015-06-16) [D]
- Improvements to the Rangitaki Control Center (rcc)
- Material Design (Blog and rcc)
## Version 0.4 (2015-06-14) [D]
- Multiple Blogs
- Online post upload (optional)
- Tags
- Author
## Version 0.3 (2015-06-11) [D]
- Portation of all main features of Version 0.2.2
- Code highlighting
*The first release with the name Rangitaki.
The following releases are of pBlog.*
## Version 0.2.2 (2015-05-13) [S]
- Links are now underlined, when you hover over them
- Simplified it to add the disqus comments
- Added and configuration option for setting a favicon
- Added the option to use Google Analytics
## Version 0.2.1 / pBlog 2.1 (2015-03-29) [S]
- Fix problems when creating article links
TODO: previous releases

View file

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015 Marcel Kapfer
Copyright (c) 2015 - 2016 Marcel Kapfer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,42 +1,91 @@
# Rangitaki
# Rangitaki PHP blogging engine
Rangitaki is a simple to use and easy to configure PHP blogging engine in php without any database dependencies.
[![Join the chat at https://gitter.im/rangitaki/rangitaki](https://badges.gitter.im/canax/view.svg)](https://gitter.im/rangitaki/view?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
##Important
Rangitaki is a simple to use and easy to configure blogging engine, written in PHP and it has absolutely no database dependencies.
Right now there are two versions in development. The series 0.2 and everything higher. Version 0.2 is ready for production while everything higher are development releases and not ready for productive use. I recommend you to use the latest Version of the 0.2 series which you can find in the branch "Series-0.2". The latest version is version 0.2.2 which is available in the releases section.
Tested with PHP version 5.5 until 7.0.
Read also [this article](http://marcel-kapfer.de/rangitaki/blog/index.php?article=About-the-Future-of-pBlog).
![Rangitaki](https://gitlab.com/mmk2410/rangitaki/raw/master/feature-graphic.png)
##Features:
[Wiki](https://gitlab.com/mmk2410/rangitaki/wikis/home)
- Post writing in XML and Markdown
- subpages for each article
- social sharing buttons
- Disqus integration
- simple end user configuration
[About](https://gitlab.com/mmk2410/rangitaki/wikis/about)
##Future Features:
[Documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs)
- **Complete rework for a better user experience** [Read more](http://marcel-kapfer.de/rangitaki/blog/index.php?article=About-the-Future-of-pBlog)
- publishing on a set time
- tags
[Quick Starting Guide](https://gitlab.com/mmk2410/rangitaki/wikis/docs/quickstart)
## Example(s)
## What is it?
- Official Rangitaki blog [marcel-kapfer.de/rangitaki/blog](http://marcel-kapfer.de/rangitaki/blog/)
My goal for Rangitaki was (and still is) to create a blogging engine without database dependencies (so you don't have to create database and tables and all that stuff) which is extremely easy and fast to setup and to learn. Rangitaki doesn't require any knowledge concerning PHP, JavaScript, HTML or CSS. You just need to know, how to upload something to your web server. There is also no need to compile anything, you just have to fill out twelve setting properties and then you can start writing your articles.
Would you like to see your Rangitaki blog here? Write me a message at [marcelmichaelkapfer@yahoo.co.nz](mailto:marcelmichaelkapfer@yahoo.co.nz)
## So, what can it do?
- Post writing in Markdown with a few keywords for the title, tags, date and the author (all optional)
- Multiple blogs
- A Subpages for each article with a comment box (Disqus; can be disabled)
- Share buttons (FAB; can be disabled)
- Disqus integration (can be disabled)
- Fast and easy configuration
- Google Analytics (optional)
- Twitter and OpenGraph meta tags
- Different themes
- Easy localization (just a few strings)
- Custom footer
- Navigation drawer (can be disabled)
- Tags
- Set author and date
- Mobile-first
- JavaScript Extension Support
- Pagination support
- Atom feed generation
- Rangitaki Control Center (RCC; optional, read the [RCC Documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs/rcc)
- Have a look under 'What is that RCC?' in this readme
## Did you say 'themes'?
Yes. Rangitaki has a theme support which makes it easy to customize your blog concerning design.
[Read the theme guide](https://gitlab.com/mmk2410/rangitaki/wikis/docs/themes)
## What is that RCC?
**This is disabled by default. Do not enable it without carefully reading the RCC documentation.**
It has the following features:
- Post upload
- Post deleting
- Post editing
- Media upload
- Atom feed generation
[Read the RCC documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs/rcc)
## Used Libraries
- [Parsedown](http://parsedown.org)
- For converting the Markdown blog articles into HTML code Rangitaki uses [Parsedown](http://parsedown.org).
- For creating the atom feeds Rangitaki uses [picoFeed](https://github.com/fguillot/picoFeed)
## Contributing
## Issues, Requests, etc.
For bug reports, feature requests and all other questions or recommendations feel free to create an issue here at [GitLab](https://gitlab.com/mmk2410/rangitaki/issues).
## Code
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new merge request
Read also the [contributing documentation](https://gitlab.com/mmk2410/rangitaki/wikis/docs/contribute)
## Social
- [Twitter @rangitaki](https://twitter.com/rangitaki)
- [Google+](https://plus.google.com/b/101437210222436501912/101437210222436501912/posts)
## Trello
You can follow me on Twitter or subscribe my blog to receive news about Rangitaki.
- [Trello Board](https://trello.com/b/7qb5I6EQ/rangitaki)
- [Twitter @mmk2410](https://twitter.com/mmk2410)
- [Blog mmk2410.org](https://mmk2410.org/), you can view the current posts about Rangitaki on [this page](https://mmk2410.org/tag/rangitaki/).

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 1
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 2
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 3
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 4
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 5
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -1,13 +0,0 @@
%TITLE: Version 2.0
%DATE: 27 March 2015
%TAGS: 0.2-Series
This version introduces some very imporant features:
- **Own page for every article**
- Social **sharing buttons** (at the moment: google+, twitter, facebook but more will follow)
- **Disqus** integration
- Local **config file** -> no more editing the index file
pBlog 2.0 is only partially compatible with prior versions. You don't have to change anything in the posts or intro file (in case you have one), but to switch to version 2.0 you have to replace your index.php with the new one. With this step all your settings like the title will be lost and you have to set them in the new config.php file. For more questions write me a mail to marcelmichaelkapfer@yahoo.co.nz.
In the near future I will spend more time in writing a documentation about the blog engine and adding more comments (especially in the css file).

View file

@ -1,4 +0,0 @@
%TITLE: Version 2.1
%DATE: 29 March 2015
This version includes fixes for the article links. You only have to replace the hrefgenerator.php file in the res folder.

View file

@ -1,6 +0,0 @@
%TITLE: About the Future of pBlog
%DATE: 29 March 2015
%AUTHOR: Marcel Michael Kapfer
%TAGS: Important, 0.2-Series
I figured out that there will be many changes in the engine which will require many changes in the files (especially the posts file) and in the filestructure. I can't say right now which things will change and what you have to change. Out of this reason. I change the Version numbers and add an zero in front of them. So instead of 2.1 the latest version is now 0.2.1. The 0.2.x series is now on GitHub as an own branch and will recive bugfix updates. The series 0.3, 0.4, 0.5 and so own will be development releases which won't be compatible to the 0.2 series. I recommend current users to stay on 0.2.x - at least until the 1.0 release. I'm verry sorry for this and in case that there are requests I may write a small script that will help you switch to version 1.0.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 1
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 2
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 3
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 4
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -0,0 +1,9 @@
%TITLE: The Rangitaki logo 5
%DATE: 24 July 2015
%TAGS: design, artwork, logo
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.

View file

@ -1,10 +0,0 @@
%TITLE: What else are we working on?
%DATE: 11 June 2015
%TAGS: Future
Near the Rangitaki PHP blogging engine there are other projects were working on or where we will start development soon:
- Rangitaki JavaScript blogging engine
- Rangitaki PHP framework
- Rangitaki JavaScript framework
- Rangitaki Polymer elements

67
bin/config.php Normal file
View file

@ -0,0 +1,67 @@
<?php
// Marcel Kapfer (mmk2410)
// Script for moving from config.php to config.yaml
// License: MIT
require 'res/php/Config.php';
require 'config.php';
use mmk2410\rbe\config\Config as Config;
if ($bloghome == "yes") {
$bloghome = "on";
}
if ($blogintro == "yes") {
$blogintro = "on";
}
if ($sharefab == "yes") {
$sharefab = "on";
}
if ($rcc == "yes") {
$rcc = "on";
}
if ($nav_drawer == "yes") {
$nav_drawer = "on";
}
$yaml = array(
"blog" => array(
"title" => $blogtitle,
"author" => $blogauthor,
"description" => $blogdescription,
"home" => $bloghome,
"homeurl" => $bloghomeurl,
"homename" => $bloghomename,
"mainname" => $blogmainname,
"intro" => $blogintro,
"disqus" => $blogdisqus,
"analytics" => $bloganalytics,
"footer" => $blogfooter,
"url" => $blogurl
),
"design" => array(
"fab" => $sharefab,
"drawer" => $nav_drawer,
"theme" => $theme,
"pagination" => $pagination,
"favicon" => $favicon,
),
"rcc" => array(
"rcc" => "off",
"api" => "off",
),
"language" => $language,
);
$config = new Config('config.yaml', 'vendor/autoload.php');
if ($config->writeConfig($yaml)) {
echo "YAML config saved.\nYou can delete the config.php file\n";
} else {
echo "Failed to save YAML config.";
}

112
bin/init.php Normal file
View file

@ -0,0 +1,112 @@
<?php
// Marcel Kapfer (mmk2410)
// PHP script for initializing Rangitaki
// MIT License
error_reporting(0);
require 'res/php/Config.php';
use mmk2410\rbe\config\Config as Config;
$config = new Config('config.yaml', 'vendor/autoload.php');
if (!file_exists('config.yaml')) {
$yaml = array();
} else {
$yaml = $config->getConfig();
}
// blog part
$yaml["blog"]["title"] = get("Title of your blog", $yaml["blog"]["title"], "Example Blog");
$yaml["blog"]["author"] = get("Your name:", $yaml["blog"]["author"], "John");
$yaml["blog"]["description"] = get("A description of your blog:", $yaml["blog"]["description"], "A short description of your blog");
$yaml["blog"]["home"] = getBool("Do you have a top site? (on/off)", $yaml["blog"]["home"], "on");
if ($yaml["blog"]["home"] == "on") {
$yaml["blog"]["homeurl"] = get("Path / Url to home page", $yaml["blog"]["homeurl"], "../");
$yaml["blog"]["homename"] = get("Name of your home page", $yaml["blog"]["homename"], "Home");
}
$yaml["blog"]["mainname"] = get("Name of the main blog (if empty, the blog title will be used)", "");
$yaml["blog"]["intro"] = getBool("Do you want a blog intro text? (on/off)", $yaml["blog"]["intro"], "on");
$yaml["blog"]["disqus"] = get("Your Disqus shortname (Leave empty to disable)", $yaml["blog"]["disqus"], "");
$yaml["blog"]["analytics"] = get("Google Analytics ID (Leave empty to disable)", $yaml["blog"]["analytics"], "");
$yaml["blog"]["footer"] = get("The footer of your blog", $yaml["blog"]["footer"], "Example Blog 2016 CC-BY-SA 4.0");
// design part
$yaml["design"]["fab"] = getBool("Would you like to use the share buttons (on/off)", $yaml["design"]["blog"], "on");
$yaml["design"]["drawer"] = getBool("Would you like the use the navigation drawer? (on/off)", $yaml["design"]["drawer"], "on");
$themes = getDir('./themes');
$yaml["design"]["theme"] = get("Which theme would you like to use? (" . $themes . ")", $yaml["design"]["theme"], "material-light");
$yaml["design"]["pagination"] =
get("Which posts should be displayed on one page (0 to disable)", $yaml["design"]["pagination"], "0");
$yaml["design"]["excerpt"] =
getBool("Should be overview pages only show a excerpt of the full posts? (on/off)", $yaml["design"]["excerpt"], "off");
$yaml["design"]["favicon"] = get("URL to your favicon", $yaml["design"]["favicon"], "https://example.com/fav.ico");
// rcc
$yaml["rcc"]["rcc"] = "off";
$yaml["rcc"]["api"] = "off";
// languages
$langs = getDir('./lang');
$yaml["language"] = get("Choose a language (" . $langs . ")", $yaml["language"], "en");
// social media
$yaml["social"]["twitter"] = get("Your Twitter username:", $yaml["social"]["twitter"], "");
$config->writeConfig($yaml);
function get($question, $value, $default)
{
if (isset($value) && $value != "") {
$input = readline($question . " (" . $value . "): ");
if ($input == "") {
return $value;
} else {
return $input;
}
} else {
$input = readline($question . " (" . $default . ")" . ": ");
if ($input == "") {
return $default;
} else {
return $input;
}
}
}
function getBool($question, $value, $default)
{
if (isset($value) && $value != "") {
$input = "someval";
while (!in_array($input, array("on", "off", ""))) {
$input = readline($question . " (" . $value . "): ");
}
if ($input == "") {
return $value;
} else {
return $input;
}
} else {
$input = "";
while (!in_array($input, array("on", "off"))) {
$input = readline($question . " (" . $default . ")" . ": ");
}
if ($input == "") {
return $default;
} else {
return $input;
}
}
}
function getDir($path)
{
$dir = scandir($path, SCANDIR_SORT_DESCENDING);
unset($dir[sizeof($dir) - 1]);
unset($dir[sizeof($dir) - 1]);
return implode(", ", $dir);
}

76
bin/init_rcc.php Normal file
View file

@ -0,0 +1,76 @@
<?php
// Marcel Kapfer (mmk2410)
// PHP script for initializing the RCC
// License: MIT
require 'res/php/Config.php';
use mmk2410\rbe\config\Config as Config;
echo 'RCC Initializion Script' . "\n";
$username = readline("Username: ");
if ($username == "") {
echo "No username given. Aborting...\n";
exit();
}
echo 'Password: ';
$password = readline("Password: ");
if ($password == "") {
echo "No password given. Aborting...\n";
exit();
}
$options = [
'cost' => 12
];
$password = password_hash($password, PASSWORD_BCRYPT, $options);
$username = '$username = "' . $username . '";';
$password = '$password = \'' . $password . '\';';
$file = '<?php' . "\n" . $username . "\n" . $password . "\n";
if (file_put_contents('./rcc/password.php', $file)) {
chmod('./rcc/password.php', 0640);
echo "\nPassword successfully saved.\n";
}
$config = new Config('config.yaml', 'vendor/autoload.php');
$yaml = $config->getConfig();
$rccOn = "";
while (!(in_array($rccOn, array("y", "Y", "n", "N")))) {
$rccOn = readline("Enable RCC: (y/n) ");
}
if (in_array($rccOn, array("y", "Y"))) {
$yaml["rcc"]["rcc"] = "on";
} else {
$yaml["rcc"]["rcc"] = "off";
}
$apiOn = "";
while (!(in_array($apiOn, array("Y", "y", "n", "N")))) {
$apiOn = readline("Enable RCC API: (y/n) ");
}
if (in_array($apiOn, array("y", "Y"))) {
$yaml["rcc"]["api"] = "on";
} else {
$yaml["rcc"]["api"] = "off";
}
$config = new Config('config.yaml', 'vendor/autoload.php');
if ($config->writeConfig($yaml)) {
echo "Changes saved.\n";
} else {
echo "Failed to save changes.\n";
}

1
blogs/example.md Normal file
View file

@ -0,0 +1 @@
%TITLE: Example

2
blogs/external.md Normal file
View file

@ -0,0 +1,2 @@
%TITLE: Docs
%URL: https://mmk2410.org/rangitaki/docs/

View file

@ -2,13 +2,8 @@
This is the Blog of the Blog Engine **Rangitaki**
Rangitaki is based on PHP, XML and Markdown. It is easy to install and to configure.
Rangitaki is based on PHP and Markdown. It is easy to install and to configure.
The latest Version of the 0.2 series is **0.2.2**
The latest version of Rangitaki is 1.4.3.
The latest Version of the development stream isn' ready yet.
** !IMPORTANT! Please read [this](index.php?article=About-the-Future-of-pBlog) for more information about the different versions of pBlog.**
You can find the source code on [GitHub](https://github.com/mmk2410/Rangitaki).
You can find the source code on [GitLab](https://gitlab.com/mmk2410/rangitaki).

View file

@ -1 +0,0 @@
%TITLE: Other projects

View file

@ -1,3 +0,0 @@
%TITLE: Rumor Edge
This is a mysterious collection about evil messages, we like to call... RUMORS.

15
ci/docker_install.sh Normal file
View file

@ -0,0 +1,15 @@
#!/bin/bash
# Only install dependencies for Docker
[[ ! -e /.dockerenv ]] && [[ ! -e /.dockerinit ]] && exit 0
set -xe
# Install git
apt-get update -yqq
apt-get install git -yqq
# Install phpunit
curl -o /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar
chmod +x /usr/local/bin/phpunit

20
composer.json Normal file
View file

@ -0,0 +1,20 @@
{
"name": "mmk2410/rangitaki",
"description": "A simple PHP blogging engine without any database requirements",
"type": "project",
"require": {
"erusev/parsedown": "^1.6",
"fguillot/picofeed": "^0.1.18",
"slim/slim": "^3.0",
"symfony/yaml": "^3.0",
"codeguy/upload": "^1.3"
},
"license": "MIT License",
"authors": [
{
"name": "Marcel Kapfer (mmk2410)",
"email": "marcelmichaelkapfer@yahoo.co.nz"
}
],
"minimum-stability": "stable"
}

496
composer.lock generated Normal file
View file

@ -0,0 +1,496 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "ccdcfdb56ed68253e2388261fbb6d1b3",
"packages": [
{
"name": "codeguy/upload",
"version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/codeguy/Upload.git",
"reference": "6a9e5e1fb58d65346d0e557db2d46fb25efd3e37"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/codeguy/Upload/zipball/6a9e5e1fb58d65346d0e557db2d46fb25efd3e37",
"reference": "6a9e5e1fb58d65346d0e557db2d46fb25efd3e37",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"type": "library",
"autoload": {
"psr-0": {
"Upload": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Josh Lockhart",
"email": "info@joshlockhart.com",
"homepage": "http://www.joshlockhart.com/"
}
],
"description": "Handle file uploads with extensible validation and storage strategies",
"homepage": "http://github.com/codeguy/Upload",
"keywords": [
"file",
"upload",
"validation"
],
"time": "2013-07-07T17:01:41+00:00"
},
{
"name": "container-interop/container-interop",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/container-interop/container-interop.git",
"reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e",
"reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-4": {
"Interop\\Container\\": "src/Interop/Container/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Promoting the interoperability of container objects (DIC, SL, etc.)",
"time": "2014-12-30T15:22:37+00:00"
},
{
"name": "erusev/parsedown",
"version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb",
"reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"psr-0": {
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "Parser for Markdown.",
"homepage": "http://parsedown.org",
"keywords": [
"markdown",
"parser"
],
"time": "2016-11-02T15:56:58+00:00"
},
{
"name": "fguillot/picofeed",
"version": "v0.1.28",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "9da506c308bcb40b6fc630f9123466028c03170b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/9da506c308bcb40b6fc630f9123466028c03170b",
"reference": "9da506c308bcb40b6fc630f9123466028c03170b",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"php": ">=5.3.0",
"zendframework/zendxml": "^1.0"
},
"require-dev": {
"phpdocumentor/reflection-docblock": "2.0.4",
"phpunit/phpunit": "4.8.26",
"symfony/yaml": "2.8.7"
},
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
"bin": [
"picofeed"
],
"type": "library",
"autoload": {
"psr-0": {
"PicoFeed": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frédéric Guillot"
}
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/fguillot/picoFeed",
"time": "2016-12-29T00:06:41+00:00"
},
{
"name": "nikic/fast-route",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/FastRoute.git",
"reference": "f3dcf5130e634b6123d40727d612ec6aa4f61fb3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/FastRoute/zipball/f3dcf5130e634b6123d40727d612ec6aa4f61fb3",
"reference": "f3dcf5130e634b6123d40727d612ec6aa4f61fb3",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"FastRoute\\": "src/"
},
"files": [
"src/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov",
"email": "nikic@php.net"
}
],
"description": "Fast request router for PHP",
"keywords": [
"router",
"routing"
],
"time": "2016-10-20T17:36:47+00:00"
},
{
"name": "pimple/pimple",
"version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/silexphp/Pimple.git",
"reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a",
"reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Pimple": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Pimple, a simple Dependency Injection Container",
"homepage": "http://pimple.sensiolabs.org",
"keywords": [
"container",
"dependency injection"
],
"time": "2015-09-11T15:10:35+00:00"
},
{
"name": "psr/http-message",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
},
{
"name": "slim/slim",
"version": "3.7.0",
"source": {
"type": "git",
"url": "https://github.com/slimphp/Slim.git",
"reference": "4254e40d81559e35cdf856bcbaca5f3af468b7ef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/slimphp/Slim/zipball/4254e40d81559e35cdf856bcbaca5f3af468b7ef",
"reference": "4254e40d81559e35cdf856bcbaca5f3af468b7ef",
"shasum": ""
},
"require": {
"container-interop/container-interop": "^1.1",
"nikic/fast-route": "^1.0",
"php": ">=5.5.0",
"pimple/pimple": "^3.0",
"psr/http-message": "^1.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0",
"squizlabs/php_codesniffer": "^2.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Slim\\": "Slim"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rob Allen",
"email": "rob@akrabat.com",
"homepage": "http://akrabat.com"
},
{
"name": "Josh Lockhart",
"email": "hello@joshlockhart.com",
"homepage": "https://joshlockhart.com"
},
{
"name": "Gabriel Manricks",
"email": "gmanricks@me.com",
"homepage": "http://gabrielmanricks.com"
},
{
"name": "Andrew Smith",
"email": "a.smith@silentworks.co.uk",
"homepage": "http://silentworks.co.uk"
}
],
"description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs",
"homepage": "https://slimframework.com",
"keywords": [
"api",
"framework",
"micro",
"router"
],
"time": "2016-12-20T20:30:47+00:00"
},
{
"name": "symfony/yaml",
"version": "v3.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "a7095af4b97a0955f85c8989106c249fa649011f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/a7095af4b97a0955f85c8989106c249fa649011f",
"reference": "a7095af4b97a0955f85c8989106c249fa649011f",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"require-dev": {
"symfony/console": "~2.8|~3.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2016-12-10T10:07:06+00:00"
},
{
"name": "zendframework/zendxml",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/zendframework/ZendXml.git",
"reference": "7b64507bc35d841c9c5802d67f6f87ef8e1a58c9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/ZendXml/zipball/7b64507bc35d841c9c5802d67f6f87ef8e1a58c9",
"reference": "7b64507bc35d841c9c5802d67f6f87ef8e1a58c9",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^3.7 || ^4.0",
"squizlabs/php_codesniffer": "^1.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-0": {
"ZendXml\\": "library/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Utility library for XML usage, best practices, and security in PHP",
"homepage": "http://packages.zendframework.com/",
"keywords": [
"security",
"xml",
"zf2"
],
"time": "2016-02-04T21:02:08+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

View file

@ -1,40 +0,0 @@
<?php
// This is the configuration file. You can configure here all necessary (and possible) options without editing the index.php file.
// Every line has an description about what you can change here. Don't delete any strings. You can set your value after the '=' sign and between the apostrophes.
// Make sure that every line ends with an semicolon (';').
// Blog Title - Set here an individual title of your blog by replacing Rangitaki Blog with it.
$blogtitle = 'Rangitaki Blog';
// Blog Author - Set here your name
$blogauthor = 'Marcel Kapfer';
// Blog description
$blogdescription = 'Rangitaki - A PHP blogging engine without any database dependency';
// Blog favicon - enter here the path to your favicon
$blogfavicon = '../res/favicon.png';
// Home - set yes if you want to link to your homepage and no if not
$bloghome = 'yes';
// Home URL - Set here the url to your main page. Either relative (e.g. '../') or absolute (e.g. 'http://github.com')
$bloghomeurl = '../';
// Home name - Set here an individual name for your main page
$bloghomename = 'Home';
// Main Blog name -> Set a specific name for your name blog
// This value is empty by default
$blogmainname = '';
// Intro - set yes if you have a blog intro and no if you don't have one
$blogintro = 'yes';
// Disqus - Provide here your Disqus shortname. Leave empty if you don't want to use it.
$blogdisqus = 'rangitaki';
// Share FAB - this enables or disables the share button
$sharefab = 'yes';
// Google Analytics - Provide here your Google Analytics Tracking-ID. Leave empty if you don't want to use it.
$bloganalytics = '';
// Footer - set here the text for your footer (e.g. a copyright info). You can replace the whole text after the '=' with your own one.
$blogfooter = 'Rangitaki ' . date("Y") . ' <a href="https://github.com/mmk2410/Rangitaki" target="blank">github.com/mmk2410/Rangitaki</a>';
// This enables the optional rangitaki control center. Please read the documentation before you enable it.
$rcc = 'no';
// Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory
$nav_drawer = 'yes';
// Set here the name of your theme. Read the documentation for more themes
$theme = 'material-light';
// Set here your language. The file must exist in the lang directory
$language = "en";

27
config.yaml Normal file
View file

@ -0,0 +1,27 @@
blog:
title: 'Example Blog'
author: John
description: 'A short description of your blog'
home: 'on'
homeurl: ../
homename: Home
mainname: ''
intro: 'on'
disqus: rangitaki
analytics: ''
footer: "Rangitaki 2016 <a href=\"https://gitlab.com/mmk2410/rangitaki\" target=\"blank\">\n gitlab.com/mmk2410/rangitaki</a>"
url: 'https://example.com/blog/'
design:
excerpt: "off"
fab: 'on'
drawer: 'on'
theme: material-light
pagination: 0
excerpt: 'off'
favicon: 'http://example.com/res/img/favicon.png'
rcc:
rcc: 'on'
api: 'on'
language: en
social:
twitter: ''

1
extensions/example.js Normal file
View file

@ -0,0 +1 @@
(function(){var e;e=function(){return console.log("Welcome Developer! \nYou're seeing the output of a\nJavaScript extension for the Rangitaki blogging engine.")},$(document).ready(e())}).call(this);

BIN
feature-graphic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

14
feed/.atom Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<generator uri="https://github.com/fguillot/picoFeed">PicoFeed</generator>
<title>Example Blog</title>
<id>https://marcel-kapfer.de/rangitaki/blog/</id>
<updated>2016-02-16T10:52:47+00:00</updated>
<link rel="alternate" type="text/html" href="https://marcel-kapfer.de/rangitaki/blog/"/>
<link rel="self" type="application/atom+xml" href="https://marcel-kapfer.de/rangitaki/blog//feed/feed.atom"/>
<author>
<name>John</name>
<email></email>
<uri>https://marcel-kapfer.de/rangitaki/blog/</uri>
</author>
</feed>

67
gulpfile.coffee Normal file
View file

@ -0,0 +1,67 @@
###
2015 - 2016 (c) by Marcel Kapfer (mmk2410)
Licensed under MIT License
Rangitaki Gulp File
###
gulp = require 'gulp'
sass = require 'gulp-sass'
sourcemaps = require 'gulp-sourcemaps'
minifyCss = require 'gulp-csso'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
uglify = require 'gulp-uglify'
merge = require 'merge-stream'
del = require 'del'
size = require 'gulp-size'
gulp.task 'coffee', ->
main = gulp.src './src/coffee/*.coffee'
.pipe coffeelint()
.pipe coffeelint.reporter()
.pipe coffee()
.pipe uglify()
.pipe gulp.dest './res/js/'
extensions = gulp.src './src/coffee-extensions/*.coffee'
.pipe coffeelint()
.pipe coffeelint.reporter()
.pipe coffee()
.pipe uglify()
.pipe gulp.dest './extensions/'
merge(main, extensions)
.pipe size {title: 'Coffee'}
gulp.task 'sass', ->
main = gulp.src './src/sass/*.sass'
.pipe sourcemaps.init()
.pipe sass {
outputStyle: 'compressed'
}
.pipe sourcemaps.write './'
.pipe gulp.dest './res/css/'
theme = gulp.src './src/sass-themes/*.sass'
.pipe sourcemaps.init()
.pipe sass {
outputStyle: 'compressed'
}
.pipe sourcemaps.write './'
.pipe gulp.dest './themes/'
merge(theme, main)
.pipe size {title: 'SASS'}
gulp.task 'clean', del.bind null, ['res/css/no-nav.css', 'res/css/rangitaki.css', 'themes/', 'res/js/app.js']
gulp.task 'init', ['coffee', 'sass']
gulp.task 'default', ->
gulp.watch './src/**/*.sass', ['sass']
gulp.watch './src/**/*.coffee', ['coffee']

653
index.php
View file

@ -1,224 +1,455 @@
<!DOCTYPE HTML>
<!-- pBlog https://github.com/mmk2410/pblog -->
<!--
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Rangitaki Blogging Engine
Code: https://gitlab.com/mmk2410/rangitaki
Issus and Project Management: https://phab.mmk2410.org
Web: https://marcel-kapfer.de/rangitaki
2015 - 2016 Marcel Kapfer (mmk2410)
License: MIT
-->
<html>
<?php
/**
* PHP Version 5.6
*
* Rangitaki PHP Blogging engine
*
* @category Blogging
* @package Rbe
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT https://opensource.org/licenses/MIT
* @link https://marcel-kapfer.de/rangitaki
*/
// Getting necessary php files
date_default_timezone_set('UTC');
require __DIR__ . '/vendor/autoload.php'; // loading composer libs
require './res/php/Config.php';
require_once './res/php/BlogListGenerator.php';
use mmk2410\rbe\config\Config as Config;
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
$configParser = new Config('config.yaml', 'vendor/autoload.php');
$config = $configParser->getConfig();
require './lang/' . $config["language"] . ".php"; // Language file
require_once 'res/php/ArticleGenerator.php'; // The article generator
// Getting some variables ($_GET and $_SERVER)
$getblog = filter_input(INPUT_GET, "blog"); // get the blog variable
$getarticle = filter_input(INPUT_GET, "article"); // get the article variable
$gettag = filter_input(INPUT_GET, "tag"); // getting the tag variable
$url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") .
filter_input(INPUT_SERVER, "REQUEST_URI"); // get the url (used for sharing)
$pagenumber = filter_input(INPUT_GET, "page"); // get the pagenumber
// Pagination algorithm
if ($config["design"]["pagination"] == 0) {
$config["design"]["pagination"] = false;
} else {
// pag_max: the newest post to show on a page
$pag_max = $config["design"]["pagination"] * ( $pagenumber + 1 );
// pag_min: the oldest post to show on a page
$pag_min = $pag_max - $config["design"]["pagination"];
if ($pagenumber > 0) {
// Disable the blog intro if not on first page
$config["blog"]["intro"] = "off";
}
}
// Fetching necessary information about the current article
// Set blog to "main" if on main blog, else to $getblog.
// This variable is needed later
if ($getblog == "") {
$blog = "main";
} else {
$blog = $getblog;
}
// generate a variable with the articles directory
$articlesdir = "./articles/$blog/";
// Fetching the articles title
if (isset($getarticle)) {
$articletitle
= ArticleGenerator::getTitle($articlesdir, $getarticle . '.md');
}
// Make sure that the entry has a title, because main.md hasn't one
if (empty($config["blog"]["mainname"])) {
$blogmaintitle = $config["blog"]["title"];
} else {
$blogmaintitle = $config["blog"]["mainname"];
}
if (isset($getblog)) {
$subblogtitle = BlogListGenerator::getName('./blogs/' . $getblog . '.md');
} else {
$subblogtitle = $blogmaintitle;
}
// Generate title for the html head
if (isset($getarticle)) {
$hd_subblog_title = $articletitle . ' - ' . $subblogtitle;
} else {
$hd_subblog_title = $subblogtitle;
}
// url of the feed
$feedurl = $config["blog"]["url"] . "/feed/" . $blog . ".atom";
?>
<head>
<meta charset="utf-8">
<title><?php echo $config["blog"]["title"] . " » " .$hd_subblog_title; ?></title>
<!--Metatags-->
<meta name="author"
content="<?php echo $config["blog"]["author"]; // Set the blog author ?>"/>
<meta name="description"
content="<?php echo $config["blog"]["description"]; // the blog description ?>"/>
<!-- Meta tag for responsive ui-->
<meta name='viewport'
content='width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=0'/>
<!-- OpenGraph meta tags -->
<meta property="og:title" content="<?php echo $hd_subblog_title; ?>"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="<?php echo $url; ?>"/>
<meta property="og:image" content="<?php echo $config['design']['favicon']; ?>"/>
<meta property="og:description" content="<?php echo $config['blog']['description']; ?>"/>
<!-- Twitter meta tags -->
<meta name="twitter:card" content="summary"/>
<meta name="twitter:site" content="<?php echo $config['social']['twitter']; ?>"/>
<meta name="twitter:title" content="<?php echo $hd_subblog_title; ?>"/>
<meta name="twitter:description" content="<?php echo $config['blog']['description']; ?>"/>
<meta name="twitter:image" content="<?php echo $config['design']['favicon']; ?>"/>
<meta name="twitter:url" content="<?php echo $url; ?>"/>
<!-- atom feed -->
<?php
include 'config.php';
include './lang/' . $language . ".php";
require_once 'res/php/Parsedown.php';
require_once 'res/php/ArticleGenerator.php';
require_once './res/php/BlogListGenerator.php';
$getblog = filter_input(INPUT_GET, "blog");
$getarticle = filter_input(INPUT_GET, "article");
$gettag = filter_input(INPUT_GET, "tag");
$url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI");
if (file_exists("feed/" . $blog . ".atom")) {
?>
<head>
<title><?php echo $blogtitle; ?></title>
<!--Metatags-->
<meta name="author" content="<?php echo $blogauthor; ?>" />
<meta name="description" content="<?php echo $blogdescription; ?>" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<!--CSS no change needed-->
<link rel="stylesheet" type="text/css" href="res/css/rangitaki.css" />
<link rel="stylesheet" type="text/css" href="themes/<?php echo $theme; ?>.css" />
<link rel='alternate' type='application/atom+xml' title='Atom 0.3' href=
'<?php
echo $feedurl;
?>'>
<?php
}
?>
<!--CSS files-->
<link rel="stylesheet" type="text/css" href="res/css/rangitaki.css"/>
<!-- stylesheet for code highlighting-->
<link rel="stylesheet" href="./res/css/github-gist.css">
<link rel="stylesheet" type="text/css"
href="themes/<?php echo $config['design']['theme']; // getting the theme stylesheet?>.css"/>
<?php
// Checking if the drawer is enabled
if ($config["design"]["drawer"] != 'on') {
// Loading additional stylesheet for disabling the drawer?>
<link rel="stylesheet" type="text/css" href="res/css/no-nav.css"/>
<?php
if ($nav_drawer == 'no') {
?>
<link rel="stylesheet" type="text/css" href="res/css/no-nav.css" />
<?php
}
?>
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,400italic,100,100italic,900' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="res/favicon.png">
<link rel="stylesheet" href="./res/css/github-gist.css">
<script src="./res/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
}
?>
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
400italic,100,100italic,900' rel='stylesheet'
type='text/css'> <!--Font-->
<!--Favicons-->
<link rel="shortcut icon" type="image/x-icon"
href="<?php echo $config['design']['favicon']; ?>"/>
<link rel="apple-touch-icon-precomposed" href="<?php echo $config['design']['favicon']; ?>">
<!-- JavaScript Pt. 1: HightlightJS (get and load): Code highlighting-->
<script src="./res/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<?php if ($nav_drawer == "yes") { ?>
<div class="overlay"></div>
<div class="nav">
<div class="divider"></div>
<?php
if ($getarticle == "") {
echo "<section>";
echo "<div class='nav-item-static'>$LANG_Blogs_Of" . " " . "$blogtitle:</div>";
$blogs = scandir("./blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if ($getblog == "") {
if ($blog != "main.md") {
if (empty($blogmainname)) {
$blogmaintitle = $blogtitle;
} else {
$blogmaintitle = $blogmainname;
}
BlogListGenerator::listBlog("./blogs/", $blog, $blogtitle);
}
} else {
if ($getblog . ".md" != $blog) {
if (empty($blogmainname)) {
$blogmaintitle = $blogtitle;
} else {
$blogmaintitle = $blogmainname;
}
BlogListGenerator::listBlog("./blogs/", $blog, $blogmaintitle);
}
}
}
}
echo "</section>";
} else {
?>
<a class="nav-item" onclick="goBack()">Go back</a>
<?php
}
?>
<div class="divider"></div>
<a class="nav-item" href="<?php echo $bloghomeurl; ?>"><?php echo $bloghomename; ?></a>
</div>
<?php
}
if ($getblog == "") {
$blog = "main";
} else {
$blog = $getblog;
}
?>
<div class="main">
<div class="header">
<img src="./res/img/menu.svg" class="nav-img" />
<nobr><span class="title"><a href="./"><?php echo $blogtitle; ?>
<?php
if (empty($getblog)) {
if (!empty($blogmainname)) {
?>
<?php
echo $blogmainname;
}
} else {
?>
</a>
<a href="<?php echo "./?blog=$getblog" ?>">
<?php
echo BlogListGenerator::getName("./blogs/$getblog.md");
}
?>
</a>
</span>
</nobr>
<div class="fadeout"></div>
</div>
<?php
if (file_exists("blogs/$blog.md") && $getarticle == "" && $blogintro == "yes" && $gettag == "") {
$file = file_get_contents("blogs/$blog.md");
$file = $file . "\n";
$file = substr($file, strpos($file, "\n"));
if ($file != "" && $file != "\n" && $file != " ") {
?>
<section class="card">
<div class="articletext">
<?php
$intro = Parsedown::instance()
->setBreaksEnabled(true)
->text($file);
echo $intro;
?>
</div>
</section>
<?php
}
}
$articlesdir = "./articles/$blog/";
if ($gettag != "") {
$articles = scandir($articlesdir, 1);
foreach ($articles as $article) {
$tags = ArticleGenerator::getTags($articlesdir, $article);
if (in_array($gettag, $tags)) {
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
ArticleGenerator::newArticle($articlesdir, $article, $getblog);
}
}
}
} else if ($getarticle == "") {
$articles = scandir($articlesdir, 1);
foreach ($articles as $article) {
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
ArticleGenerator::newArticle($articlesdir, $article, $getblog);
}
}
} else {
ArticleGenerator::newArticle($articlesdir, $getarticle . ".md", $getblog);
include './res/php/SocialBar.php';
include './res/php/Disqus.php';
}
?>
<div class="footer">
<?php echo $blogfooter; ?>
</div>
<?php
if ($sharefab == "yes") {
?>
<div class="fabmenu">
<div class="subfab">
<a href='mailto:?subject=<?php echo $blogtitle; ?>&body=<?php echo $LANG_Check_out_this_blog; ?>: <?php echo $url; ?>' target="blank">
<img src="./res/img/email.svg" class="subfab-img" />
</a>
</div>
<div class="subfab">
<a href='https://twitter.com/intent/tweet?text=<?php echo $LANG_Check_out; ?>: <?php echo $url; ?>&original_referer=' target="blank">
<img src="./res/img/twitter.svg" class="subfab-img" />
</a>
</div>
<div class="subfab">
<a href='https://plus.google.com/share?url=<?php echo $url; ?>&hl=en-US' target="blank">
<img src="./res/img/gplus.svg" class="subfab-img" />
</a>
</div>
<div class="subfab">
<a href='https://www.facebook.com/sharer/sharer.php?u=<?php echo $url; ?>&t=<?php echo "echo $blogtitle" ?>' target="blank">
<img src="./res/img/facebook.svg" class="subfab-img" />
</a>
</div>
<div class="fab">
<img src="./res/img/share.svg" class="fab-img" alt="Share" />
</div>
</div>
<?php
}
?>
<body>
<?php
// Checking if the navigation drawer is enabled. If not -> skip it
if ($config["design"]["drawer"] == "on") {
?>
<!--
Darken the background when fading the drawer in. See also the JS file
-->
<div class="overlay"></div>
<div class="nav">
<div class="nav-close">
<img src="./res/img/close-dark.svg" class="nav-close-img"
alt="Close"/>
</div>
<script src="./res/js/jquery-2.1.4.min.js"></script>
<script src="./res/js/app.js"></script>
<div class="divider"></div>
<?php
include './res/php/GoogleAnalytics.php';
// Getting everything from the blog directory
$blogs = scandir("./blogs/");
// Checking if not in article or tag view and if there are more the one
// blog. The 3 is for these three array entries: 'main.md', '.', '..'
if (!isset($getarticle) && !isset($gettag) && sizeof($blogs) > 3) {
echo "<section>";
// 1. Set localized string 2. Set blogtitle
echo "<div class='nav-item-static'>" .
$BLOGLANG['Blogs on'] . " " . $config["blog"]["title"] .
":</div>";
// iterating through the blogs/ directory
foreach ($blogs as $navblog) {
// check if filename is larger than three chars and if the
// file ends with ".md"
if (strlen($navblog) >= 3 && substr($navblog, -3) == ".md") {
if ($getblog == "") { // Run when on main blog
if ($navblog != "main.md") { // excluding main blog
// creating navigation item
echo BlogListGenerator::listBlog(
"./blogs/",
$navblog,
$config["blog"]["title"]
);
}
} else {
// Check if $blog is current blog
// -> this blog will be excluded
if ($getblog . ".md" != $navblog) {
// creating navigation item
echo BlogListGenerator::listBlog(
"./blogs/",
$navblog,
$blogmaintitle
);
}
}
}
}
echo "</section>";
} elseif (isset($getarticle) || isset($gettag)) {
// If viewing a blog or a tag
?>
<!-- Set a back item instead of the blogs. -->
<a class="nav-item" onclick="history.go(-1);">Go back</a>
<?php
}
if ($config["blog"]["home"] == "on") { // If a blog home is existend
?>
<div class="divider"></div>
<a class="nav-item" href="<?php echo $config['blog']['homeurl']; ?>">
<?php echo $config['blog']['homename']; ?>
</a>
<?php
}
if (file_exists("feed/" . $blog . ".atom")) { ?>
<div class="divider"></div>
<a class="nav-item" href=
'<?php
echo $feedurl;
?>'>Feed</a><?php
}
?>
</body>
</div> <!-- End of the navigation drawer-->
<?php
} // Endif from line 97; Yes, I really should think about alternative syntax...
?>
<div class="main"> <!-- Main page with content -->
<div class="header">
<!--
Action Bar, but since there isn't much action I call it header.
One day a search feature would be nice...
-->
<!-- Ham,ham,hamburger-->
<img src="./res/img/menu.svg" class="nav-img"/>
<!-- Blog title with subblog title and links to each one-->
<!-- link to main blog-->
<nobr><span class="title"><a href="./"><?php echo $config["blog"]["title"]; ?>
<?php
if (empty($getblog)) { // if not on a subblog
if (!empty($config['blog']['mainname'])) {
// If you see a (square) here : This is not a bug,
// but a missing sign in your font
echo "" . $config['blog']['mainname'];
}
} else { // On subblog: set also a link to the subblog
?>
</a>
<a href="<?php echo "./?blog=$getblog" ?>">
<?php
// get the blog name
echo BlogListGenerator::getName("./blogs/$getblog.md");
}
?>
</a>
</span>
</nobr>
<div class="fadeout"></div>
<!--
if the blog name is to long (especially on mobile devices), a fadeout
fades the text out at the end of the header
-->
</div>
<?php
// Blog Intro text
if (file_exists("blogs/$blog.md")
&& $getarticle == ""
&& $config["blog"]["intro"] == "on"
&& $gettag == ""
) {
// only shown if not in article or tag view
// and if the blogintro is enabled
// get content of the blog file
$file = file_get_contents("blogs/$blog.md");
// add a line break. necessary if the editor didn't make
// one while saving
$file = $file . "\n";
// basically removing the first line, which contains the blog title
$file = substr($file, strpos($file, "\n"));
if (strlen($file) > 3) { // if there is no content, don't show the intro
?>
<section class="card" id="intro">
<div class="articletext">
<?php // generate the html text from the markdown file
$intro = Parsedown::instance()
->setBreaksEnabled(true)// with linebreaks
->text($file);
echo $intro; // PRINTS THE SH****
?>
</div>
</section>
<?php
}
}
// TAG VIEW
if (isset($gettag)) { // if there's a tag -> tag view
// save the content of the directory in the articles variable
$articles = scandir($articlesdir, 1);
// iterate through all articles
foreach ($articles as $article) {
// get the article tags
$tags = ArticleGenerator::getTags($articlesdir, $article);
// if the article has the requested tag
if (in_array($gettag, $tags)) {
// check if the file is a article file
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
// generate the article
ArticleGenerator::newArticle(
$articlesdir,
$article,
$getblog,
$config["design"]["excerpt"],
$BLOGLANG["Read More"]
);
}
}
}
} elseif ($getarticle == "") {
// NORMAL VIEW if there's no article request -> normal view
// save the content of the directory in the articles variable
$articles = scandir($articlesdir, 1);
// iterate through this variable
$posts_amount = 0;
foreach ($articles as $article) {
// check if the file is a article file
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
// generate the article
if ($config["design"]["pagination"]) {
if ($posts_amount < $pag_max && $posts_amount >= $pag_min) {
ArticleGenerator::newArticle(
$articlesdir,
$article,
$getblog,
$config["design"]["excerpt"],
$BLOGLANG["Read More"]
);
}
} else {
ArticleGenerator::newArticle(
$articlesdir,
$article,
$getblog,
$config["design"]["excerpt"],
$BLOGLANG["Read More"]
);
}
}
$posts_amount++;
}
if ($config["design"]["pagination"]) {
include './res/php/Pagination.php';
}
} elseif (isset($getarticle)) { // ARTICLE VIEW
// generate the requested article
ArticleGenerator::newArticle(
$articlesdir,
$getarticle . ".md",
$getblog,
'off',
$BLOGLANG["Read More"]
);
include './res/php/Disqus.php'; // include disques
} else { // SOMETHING STRANGE: THIS SHOULDN'T HAPPEN
echo "Some error occured, please go back.";
}
?>
<div class="footer">
<?php echo $config["blog"]["footer"]; //print the blog footer?>
</div>
<?php
// show the fab if it's enabled
if ($config["design"]["fab"] == "on") {
?>
<div class="fabmenu">
<div class="subfab"><!--Email subfab-->
<a href='mailto:?subject=<?php
echo $config["blog"]["title"];
?>&body=<?php
echo $BLOGLANG['Check out this blog'];
?>: <?php
echo $url;
?>' target="blank">
<img src="./res/img/email.svg" class="subfab-img"/>
</a>
</div>
<div class="subfab"><!--twitter subfav-->
<a href='https://twitter.com/intent/tweet?text=<?php
echo $BLOGLANG['Check out'];
?>: <?php
echo $url;
?>&original_referer=' target="blank">
<img src="./res/img/twitter.svg" class="subfab-img"/>
</a>
</div>
<div class="subfab"><!--gplus subfab-->
<a href='https://plus.google.com/share?url=<?php
echo $url;
?>&hl=en-US' target="blank">
<img src="./res/img/gplus.svg" class="subfab-img"/>
</a>
</div>
<div class="subfab"><!--facebook subfab-->
<a href='https://www.facebook.com/sharer/sharer.php?u=<?php
echo $url;
?>&t=<?php
echo "echo " . $config["blog"]["title"];
?>' target="blank">
<img src="./res/img/facebook.svg" class="subfab-img"/>
</a>
</div>
<div class="fab"><!-- share fab-->
<img src="./res/img/share.svg" class="fab-img" alt="Share"/>
</div>
</div>
<?php
}
?>
</div>
<script src="./res/js/jquery-2.1.4.min.js"></script> <!-- include jquery-->
<script src="./res/js/app.js"></script> <!--include main javascript-->
<!-- JS extension support -->
<?php
if (file_exists("./extensions")) {
$extensions = scandir('./extensions');
foreach ($extensions as $extension) {
if (substr($extension, -3) == ".js") {
echo "<script src='./extensions/$extension'></script>";
}
}
}
?>
<?php
require './res/php/GoogleAnalytics.php'; // include google analytics
?>
</body>
</html>

12
lang/de.php Normal file
View file

@ -0,0 +1,12 @@
<?php
// Rangitaki Project
// LANGUAGE: GERMAN
$BLOGLANG = [
"Blogs on" => "Blogs auf",
"Check out this blog" => "Schau dir diesen Blog an:",
"Check out" => "Schau dir das an:",
"Next Page" => "Nächste Seite",
"Previous Page" => "Vorherige Seite",
"Read More" => "Weiterlesen",
];

View file

@ -1,7 +1,12 @@
<?php
// Rangitaki Project
// LANGUAGE: ENGLISH
// This is the default language file for PHP
$LANG_Blogs_Of = "Blogs of";
$LANG_Check_out_this_blog = "Check out this blog";
$LANG_Check_out = "Check out";
$BLOGLANG = [
"Blogs on" => "Blogs on",
"Check out this blog" => "Check out this blog:",
"Check out" => "Check out:",
"Next Page" => "Next Page",
"Previous Page" => "Previous Page",
"Read More" => "Read More",
];

BIN
media/example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

37
package.json Normal file
View file

@ -0,0 +1,37 @@
{
"name": "rangitaki",
"version": "1.5.0",
"description": "A simple PHP blogging engine without any database dependencies",
"main": "index.php",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com/mmk2410/rangitaki.git"
},
"keywords": [
"blogging",
"php"
],
"author": "Marcel Kapfer (mmk2410)",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/mmk2410/rangitaki/issues"
},
"homepage": "https://gitlab.com/mmk2410/rangitaki#README",
"devDependencies": {
"coffee-script": "^1.10.0",
"del": "^2.2.0",
"gulp": "^3.9.1",
"gulp-coffee": "^2.3.2",
"gulp-coffeelint": "^0.6.0",
"gulp-csso": "^2.0.0",
"gulp-sass": "^2.3.1",
"gulp-size": "^2.1.0",
"gulp-sourcemaps": "^2.0.0-alpha",
"gulp-uglify": "^1.5.3",
"merge-stream": "^1.0.0",
"node-sass": "^3.7.0"
}
}

22
rcc/api/auth/auth.php Normal file
View file

@ -0,0 +1,22 @@
<?php
// Marcel Kapfer (mmk2410)
// License: MIT License
// HTTP Basic Auth for the API
$basedir = "../../../";
require '../../ssl.php';
require '../../password.php';
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="RCC API"');
header('HTTP/1.1 401 Unauthorized');
echo "Access denied to the RCC API!";
exit;
} elseif ($_SERVER['PHP_AUTH_USER'] != $username ||
!password_verify($_SERVER['PHP_AUTH_PW'], $password)) {
header('HTTP/1.1 401 Unauthorized');
echo "Wrong credentials: Access denied!";
exit;
}

59
rcc/api/list/index.php Normal file
View file

@ -0,0 +1,59 @@
<?php
// Marcel Kapfer (mmk2410)
// License: MIT License
// api for fetching various lists
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require '../../../vendor/autoload.php';
require '../../../res/php/Config.php';
use \mmk2410\rbe\config\Config as Config;
$config = new Config("../../../config.yaml", '../../../vendor/autoload.php');
$settings = $config->getConfig();
include '../auth/auth.php';
if ($settings["rcc"]["api"] == "on" && $settings["rcc"]["rcc"] == "on") {
$app = new \Slim\App();
/**
* api for get the list of blogs and if $_GET["blog"] is set the list of
* blogs posts in that blog
*
* @param string $_GET["blog"] optional name of the blog
*
* @return JSON json string containing the blogs / blog posts
*/
$app->get('/', function (Request $request, Response $response) {
$blog = $_GET["blog"];
if (!isset($blog)) {
$files = scandir('../../../blogs/', SCANDIR_SORT_DESCENDING);
unset($files[sizeof($files) - 1]);
unset($files[sizeof($files) - 1]);
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($files, 201);
return $response;
}
$path = "../../../articles/" . $blog . "/";
$files = scandir($path, SCANDIR_SORT_DESCENDING);
unset($files[sizeof($files) - 1]);
unset($files[sizeof($files) - 1]);
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($files, 201);
return $response;
});
$app->run();
}

48
rcc/api/media/index.php Normal file
View file

@ -0,0 +1,48 @@
<?php
// Marcel Kapfer (mmk2410)
// License: MIT License
// api for uploading files
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require '../../../vendor/autoload.php';
require '../../../res/php/Config.php';
require '../../../res/php/ArticleGenerator.php';
use \mmk2410\rbe\config\Config as Config;
$config = new Config("../../../config.yaml", '../../../vendor/autoload.php');
$settings = $config->getConfig();
include '../auth/auth.php';
if ($settings["rcc"]["api"] == "on" && $settings["rcc"]["rcc"] == "on") {
$app = new \Slim\App();
/**
* api for uploading files
*
* @return JSON json string with status
*/
$app->post('/', function (Request $request, Response $response) {
$storage = new \Upload\Storage\FileSystem('../../../media/');
$file = new \Upload\File('file', $storage);
try {
$file->upload();
$data = array("code" => 201);
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 201);
} catch (\Exception $e) {
$errors = $file->getErrors();
$data = array("code" => 500, "error" => $Errors);
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 500);
}
return $response;
});
$app->run();
}

141
rcc/api/post/index.php Normal file
View file

@ -0,0 +1,141 @@
<?php
// Marcel Kapfer (mmk2410)
// License: MIT License
// api for accessing blog posts
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require '../../../vendor/autoload.php';
require '../../../res/php/Config.php';
require '../../../res/php/ArticleGenerator.php';
use \mmk2410\rbe\config\Config as Config;
$config = new Config("../../../config.yaml", '../../../vendor/autoload.php');
$settings = $config->getConfig();
include '../auth/auth.php';
if ($settings["rcc"]["api"] == "on" && $settings["rcc"]["rcc"] == "on") {
$app = new \Slim\App();
/**
* api for fetching a blog post
*
* @param string $_GET["blog"] name of the blog
* @param string $_GET["post"] filename of the blog post
*
* @return JSON json string containing the blog post
*/
$app->get('/', function (Request $request, Response $response) {
$blog = $_GET["blog"];
$post = $_GET["post"];
if (!isset($blog) || !isset($post)) {
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'Not enough arguments');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 400);
return $response;
}
$path = "../../../articles/" . $blog . "/";
$data =
ArticleGenerator::getArray($path, $post);
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 201);
return $response;
});
/**
* api for changing/creating a blog post
*
* @param string $_POST["data"] all data
*/
$app->post('/', function (Request $request, Response $response) {
$blog = $_POST["blog"];
$post = $_POST["post"];
$title = $_POST["title"];
$author = $_POST["author"];
$date = $_POST["date"];
$tags = $_POST["tags"];
$text = $_POST["text"];
if (!isset($blog) || !isset($post) || (!isset($title) && !isset($text))) {
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'Not enough arguments');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 400);
return $response;
}
$text = str_replace('\n', '<br>', $text);
$md = <<<EOD
%TITLE: $title
%DATE: $date
%AUTHOR: $author
%TAGS: $tags
$text
EOD;
$path = "../../../articles/$blog/$post";
if (file_put_contents($path, $md)) {
$data = array('code' => 201, 'status' => 'Post created successfully');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 201);
} else {
$data = array('code' => 500, 'status' => 'Internal server error');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 500);
}
return $response;
});
/**
* api for deleting a blog post
*
* @param string $_GET["blog"] name of the blog
* @param string $_GET["post"] filename of the blog post
*
* @return JSON json string containing the blog post
*/
$app->delete('/', function (Request $request, Response $response) {
$blog = $_GET["blog"];
$post = $_GET["post"];
if (!isset($blog) || !isset($post)) {
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'Not enough arguments');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 400);
return $response;
}
$path = "../../../articles/$blog/$post";
if (!file_exists($path)) {
$data = array('code' => 400, 'status' => 'Bad Request', 'error' => 'No such file');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 400);
return $response;
}
if (!unlink($path)) {
$data = array('code' => 500, 'status' => 'Bad Request', 'error' => 'Internal server error');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 500);
return $response;
}
$data = array('code' => 201, 'status' => 'File successfully deleted');
$response = $response->withHeader('Content-type', 'application/json');
$response = $response->withJson($data, 201);
return $response;
});
$app->run();
}

172
rcc/edit/index.php Normal file
View file

@ -0,0 +1,172 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* Edit page of RCC (Rangitaki Control Center)
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
date_default_timezone_set('UTC');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0" name="viewport"/>
<meta name="theme-color" content="#383838">
<meta name="description" content="Rangitaki Control Center (RCC)">
<link rel="stylesheet" href="../res/rcc.css"/>
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
400italic,100,100italic,900' rel='stylesheet'
type='text/css'> <!--Font-->
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<?php
session_start();
if ($_SESSION['login']) {
include_once "../../res/php/ArticleGenerator.php";
$directory = "./../../articles/" . $_GET['blog'] . "/";
$article = $_GET['post'] . ".md";
?>
<!-- Edit Post -->
<section class="card">
<div class="headline">Edit Post</div>
<p>Title:
<br><br>
<input type="text" class="itextfield"
value="<?php
echo ArticleGenerator::getTitle($directory, $article);
?>" name="title" id="title"/>
</p>
<p>Date:
<br><br>
<input type="text" class="itextfield"
value="<?php
echo ArticleGenerator::getDate($directory, $article);
?>" name="date" id="date"/>
</p>
<p>Author:
<br><br>
<input type="text" class="itextfield"
value="<?php
echo ArticleGenerator::getAuthor($directory, $article);
?>" name="author" id="author"/>
</p>
<p>Tags:
<br><br>
<input type="text" class="itextfield"
value="<?php
$tags = "";
foreach (
ArticleGenerator::getTags($directory, $article)
as $tag) {
$tags = $tags . ', ' . $tag;
}
$tags = substr($tags, 2);
echo $tags;
?>" name="tags" id="tags"/>
</p>
<p>Text:</p>
<textarea class="itextarea" name="text" id="text">
<?php
echo ArticleGenerator::getText($directory, $article);
?>
</textarea>
<br><br>
<a class="button" id="save_changes">SAVE CHANGES</a>
</section>
<!-- Go Back -->
<section class="card">
<div class="headline">Back</div>
<p>
Go back to the RCC home. All changes will be lost.
</p>
<a class="button" href="../">BACK</a>
</section>
<?php
} else {
?>
<!-- Access denied -->
<section class="card">
<div class="headline">Access denied</div>
<p>
The access to this area is not granted. Make sure you're logged
in.
</p>
<a class="button" href="../">BACK</a>
</section>
<?php
}
?>
</div>
<script>
var getVariables = <?php echo json_encode($_GET); ?>;
</script>
<script src="../../res/js/jquery-2.1.4.min.js"></script>
<script src="../res/rcc.js"></script>
<script src="../res/edit.js"></script>
</body>
</html>

148
rcc/feed/index.php Normal file
View file

@ -0,0 +1,148 @@
<?php
/**
* PHP Version 7
*
* @category Atom_Feed
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://gitlab.com/mmk2410/rangitaki
*
* Feed Generator
*
* The MIT License
*
* Copyright 2015 - 2016 (c) mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
date_default_timezone_set('UTC');
require "../../vendor/autoload.php";
require "../../res/php/Config.php";
require_once "../../res/php/ArticleGenerator.php";
use PicoFeed\Syndication\AtomFeedBuilder;
use PicoFeed\Syndication\AtomItemBuilder;
use \mmk2410\rbe\config\Config as Config;
$config = new Config('../../config.yaml', '../../vendor/autoload.php');
$settings = $config->getConfig();
include '../ssl.php';
session_start();
if ($_SESSION['login']) {
$art_dir = "./../../articles/" . $_GET['blog'] . "/";
$feed_path = "./../../feed/" . $_GET['blog'] . ".atom";
if ($_GET['blog'] == "main") {
$blogtitle = $settings['blog']['title'];
} else {
$blogtitl = $settings['blog']['title'] . " - " . ucwords($_GET['blog']);
}
$feedBuilder = AtomFeedBuilder::create()
->withTitle($blogtitle)
->withAuthor($settings['blog']['author'])
->withFeedUrl($settings['blog']['url'] . "/feed/" . $_GET['blog'] . ".atom")
->withSiteUrl($settings['blog']['url'])
->withDate(new DateTime(date(DATE_ATOM)));
$articles = scandir($art_dir, 1);
$amount = 0;
foreach ($articles as $article) {
if (strlen($article) >= 3 && substr($article, -3) == ".md") {
if ($amount == 10) {
break;
} else {
$file = ArticleGenerator::getText($art_dir, $article);
$text = Parsedown::instance()
->setBreaksEnabled(true)// with linebreaks
->text($file);
if (new DateTime(date(DATE_ATOM, strtotime($datestring))) != null) {
$date = new DateTime(
date(
DATE_ATOM,
strtotime($datestring)
)
);
} else {
$date = new DateTime(date(DATE_ATOM));
}
$date = new DateTime(date(DATE_ATOM));
$feedBuilder
->withItem(AtomItemBuilder::create($feedBuilder)
->withTitle(
ArticleGenerator::getTitle($art_dir, $article)
)
->withUrl(
$settings['blog']['url'] . "./?article=" . substr($article, 0, strlen($article) - 3)
)
->withAuthor(
ArticleGenerator::getAuthor($art_dir, $article)
)
->withPublishedDate(
parseDate(ArticleGenerator::getDate($art_dir, $article))
)
->withUpdatedDate(
parseDate(ArticleGenerator::getDate($art_dir, $article))
)
->withSummary(
ArticleGenerator::getSummary($art_dir, $article)
)
->withContent($text));
$amount += 1;
}
}
}
$feed = $feedBuilder->build();
$file = fopen($feed_path, "w");
if (fwrite($file, $feed) === false) {
echo "-1";
exit;
}
fclose($file);
echo "0";
}
function parseDate($datestring)
{
$datetime = new DateTime(date(DATE_ATOM));
try {
$datetime = new DateTime(
date(
DATE_ATOM,
strtotime($datestring)
)
);
} catch (Exception $e) {
$datetime = new DateTime(date(DATE_ATOM));
}
return $datetime;
}

View file

@ -1,55 +0,0 @@
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="stylesheet" href="../res/rcc.css" />
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">Password Generator</div>
<?php
$passwd = filter_input(INPUT_POST, "passwd");
if (passwd == "") {
?>
<form action="./" method="post">
<p>New password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
<input type="submit" value="Get password" class="button"/>
</form>
<?php
} else {
echo "<p style='word-wrap: break-word;'>" . password_hash($passwd, PASSWORD_DEFAULT) . "</p>";
}
?>
</section>
</div>
</body>
</html>

View file

@ -1,115 +1,326 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* Main page of RCC (Rangitaki Control Center)
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
require '../vendor/autoload.php';
require '../res/php/Config.php';
require "./../res/php/BlogListGenerator.php";
use \mmk2410\rbe\config\Config as Config;
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
$config = new Config("../config.yaml", '../vendor/autoload.php');
$settings = $config->getConfig();
include './ssl.php';
?>
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="stylesheet" href="./res/rcc.css" />
</head>
<body>
<div class="header">
<a href="./" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0" name="viewport"/>
<meta name="theme-color" content="#383838">
<meta name="description" content="Rangitaki Control Center (RCC)">
<link rel="stylesheet" href="./res/rcc.css"/>
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
400italic,100,100italic,900' rel='stylesheet'
type='text/css'> <!--Font-->
</head>
<body>
<div class="header">
<a href="./" class="title">Rangitaki Control Center</a>
<a href="../" class="back">Back to the blog</a>
</div>
<div class="main">
<?php
$config = $settings;
if ($config["rcc"]["rcc"] == "on") {
include 'password.php';
session_start();
if (isset($_POST['passwd'])) {
$passwd = $_POST['passwd'];
$_SESSION['passwd'] = $_POST['passwd'];
} elseif (isset($_SESSION['passwd'])) {
$passwd = $_SESSION['passwd'];
}
if ($passwd == "") {
?>
<!-- Login Card -->
<section class="card">
<div class="headline">Log In</div>
<form action="./" method="post">
<p>Password:
<br><br>
<input type="password" class="itextfield" name="passwd"/>
</p>
<input type="Submit" class="button" value="Log in"/>
</form>
</section>
<?php
} else {
if (password_verify($passwd, $password)) {
$_SESSION['login'] = true;
?>
<!-- Post Upload -->
<section class="card">
<div class="headline">Post Upload</div>
<form enctype="multipart/form-data" action="uploaded/"
method="POST">
<select name="blog">
<?php
include '../config.php';
$passwd = filter_input(INPUT_POST, "passwd");
if ($rcc == "yes") {
if ($passwd == "") {
?>
<section class="card">
<div class="headline">Log In</div>
<form action="./" method="post">
<p>Password:<br><br><input type="password" class="itextfield" name="passwd"/></p>
<input type="Submit" class="button" value="Log in"/>
</form>
</section>
<?php
} else {
chmod("passwd.txt", 0644);
$hash = file_get_contents("passwd.txt");
chmod("passwd.txt", 0000);
if (password_verify($passwd, $hash)) {
?>
<section class="card">
<div class="headline">File Upload</div>
<form enctype="multipart/form-data" action="uploaded/" method="POST">
<select name="blog">
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
?>
</select>
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input id="" name="userfile" type="file" value="Choose a file" />
<br>
<br>
<input id="button" type="submit" value="Upload" class="button"/>
</form>
</section>
<?php
} else {
?>
<section class="card">
<div class="headline">Wrong Password</div>
<p>
Please go back and try again.
</p>
<a href="./" class="button">GO BACK</a>
</section>
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
?>
<section class="card">
<div class="headline">Password</div>
<p>
Generate a new password.
</p>
<a class="button" href="./genpas/">
GENERATOR
</a>
</section>
<?php
} else {
?>
<section class="card">
<div class="headline">Rangitaki Control Center</div>
<p>
The Rangitaki Control Center is disabled. You can enable it in your config file. But please read first the documentation.
</p>
</section>
<?php
}
?>
</div>
</body>
</select>
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/>
<input id="" name="userfile" type="file" value="Choose a file"/>
<br><br>
<input id="button" type="submit" value="Upload" class="button"/>
</form>
</section>
<!-- New Post -->
<section class="card">
<div class="headline">New Post</div>
<form action="newpost/" method="POST">
<p>Blog:</p>
<select name="blog">
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
}
?>
</select>
<p>Title:
<br><br>
<input type="text" class="itextfield" name="title"/>
</p>
<p>Date:
<br><br>
<input type="text" class="itextfield" name="date"/>
</p>
<p>Author:
<br><br>
<input type="text" class="itextfield" name="author"/>
</p>
<p>Tags:
<br><br>
<input type="text" class="itextfield" name="tags"/>
</p>
<p>Text:</p>
<textarea class="itextarea" name="text"></textarea>
<br><br>
<input id="button" type="submit" value="Post"
class="button"/>
</form>
</section>
<!-- Edit post -->
<section class="card">
<div class="headline">Edit post</div>
<p>
First select the blog of the post you wan't to edit.
</p>
<p id="edit_select_blog">
<select name="blog" id="edit_selected_blog">
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
}
?>
</select>
</p>
<a class="button" id="edit_get_posts">GET POSTS</a>
</section>
<!-- Delete Post -->
<section class="card">
<div class="headline">Delete Post</div>
<p>
First select the subblog of the post you want to delete.
</p>
<p id="delete_select_blog">
<select name="blog" id="delete_selected_blog">
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
}
?>
</select>
</p>
<a class="button" id="delete_get_posts">GET POSTS</a>
</section>
<!-- Media Upload -->
<section class="card">
<div class="headline">Media Upload</div>
<form enctype="multipart/form-data" action="media/" method="POST">
<input type="hidden" name="MAX_FILE_SIZE"
value="100000000000"/>
<input id="" name="userfile" type="file" value="Choose a file"/>
<br><br>
<input id="button" type="submit" value="Upload" class="button"/>
</form>
</section>
<!-- Atom Feed Generator -->
<section class="card">
<div class="headline">Atom Feed Generator</div>
<p>
<select name="blog" id="generate_atom_blog">
<?php
$blogs = scandir("../blogs/");
foreach ($blogs as $blog) {
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if (BlogListGenerator::getExternalLink($blog, '../') == null) {
$blog = substr($blog, 0, -3);
echo "<option value='$blog'>$blog</option>";
}
}
}
?>
</select>
</p>
<a class="button" id="generate_atom">GENERATE</a>
</section>
<?php
} else {
?>
<!-- Wrong Password -->
<section class="card">
<div class="headline">Wrong Password</div>
<p>
The entered password was wrong, please try again.
</p>
<form action="./" method="post">
<p>Password:
<br><br>
<input type="password" class="itextfield" name="passwd"/>
</p>
<input type="Submit" class="button" value="Log in"/>
</form>
</section>
<?php
}
}
} else {
?>
<!-- Not enabled -->
<section class="card">
<div class="headline">Rangitaki Control Center</div>
<p>
The Rangitaki Control Center is disabled. You can enable
it in your config file. But please read first the
documentation.
</p>
</section>
<?php
}
?>
<!-- Back -->
<section class="card" id="back-card">
<div class="headline">Back</div>
<p>Go back to your blog.</p>
<a href="../" class="button">GO BACK</a>
</section>
</div>
<script src="./res/rcc.js"></script>
<script src="../res/js/jquery-2.1.4.min.js"></script>
<script src="./res/delete.js"></script>
<script src="./res/edit.js"></script>
<script src="./res/atom.js"></script>
</body>
</html>

100
rcc/media/index.php Normal file
View file

@ -0,0 +1,100 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* Media page of RCC (Rangitaki Control Center)
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0" name="viewport"/>
<meta name="theme-color" content="#383838">
<meta name="description" content="Rangitaki Control Center (RCC)">
<link rel="stylesheet" href="../res/rcc.css"/>
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
400italic,100,100italic,900' rel='stylesheet'
type='text/css'> <!--Font-->
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">File Upload</div>
<?php
session_start();
if ($_SESSION['login']) {
if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>";
} else {
$uploaddir = "../../media/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo
"<p>
The post was successfully uploaded and is now published.
</p>";
} else {
echo
"<p>During the uploading process an error occured! <br>
Error Code:"
. ($_FILES['userfile']['error'] . "</p>");
}
}
?>
<a href="../" class="button">GO BACK</a>
<?php
}
?>
</section>
</div>
</body>
</html>

106
rcc/newpost/index.php Normal file
View file

@ -0,0 +1,106 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* Newpost page of RCC (Rangitaki Control Center)
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
date_default_timezone_set('UTC');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0" name="viewport"/>
<meta name="theme-color" content="#383838">
<meta name="description" content="Rangitaki Control Center (RCC)">
<link rel="stylesheet" href="../res/rcc.css"/>
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
400italic,100,100italic,900' rel='stylesheet'
type='text/css'> <!--Font-->
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">New Post</div>
<?php
session_start();
if ($_SESSION['login']) {
$title = $_POST["title"];
$date = $_POST["date"];
$author = $_POST["author"];
$tags = $_POST["tags"];
$text = $_POST["text"];
$blog = $_POST["blog"];
$md = <<<EOD
%TITLE: $title
%DATE: $date
%AUTHOR: $author
%TAGS: $tags
$text
EOD;
$filename = date("Y-m-d-H-i-s") . ".md";
$handle = fopen("../../articles/$blog/$filename", "c");
fwrite($handle, $md);
if (fclose($handle)) {
echo "Post successfully published.";
} else {
echo "Some error happend, while publishing.";
}
?>
<a href="../" class="button">GO BACK</a>
<?php
}
?>
</section>
</div>
</body>
</html>

View file

@ -1 +0,0 @@
$2y$10$vgN9txL19vvXKAT.ywFy5u0ApyZ3XAgExBtSff53RUJcnwbsNGBAm

3
rcc/password.php Normal file
View file

@ -0,0 +1,3 @@
<?php
$username = "test";
$password = '$2y$12$nHitKTwHqU4GmI3ADVE05eH/723fCNgdQ65kQ53FyZUVVB03BjfCO';

25
rcc/res/atom.js Normal file
View file

@ -0,0 +1,25 @@
/**
* JavaScript for the ajax request to generate a atom feed
*
* Copyright (c) 2016 by mmk2410
* License: MIT License
*/
function main() {
// listener and function for calling the ajax request to create the
// requested atom feed
$("#generate_atom").click(function () {
var selectedBlog = $("#generate_atom_blog").val();
$.get("feed/index.php", {
blog: selectedBlog
}, function (data) {
if (data == "0") {
alert("Atom feed sucessfully created.");
} else {
alert("Failed to create atom feed.");
}
});
});
}
$(document).ready(main());

82
rcc/res/delete.js Normal file
View file

@ -0,0 +1,82 @@
/**
* JavaScript for the ajax request to delete blog post
*
* Copyright (c) 2016 by mmk2410
* License: MIT License
*/
function main() {
// listener and function for recieving the posts of the selected blogs
$("#delete_get_posts").click(function () {
var selectedBlog = $("#delete_selected_blog").val();
$.get("res/get_posts.php", {
blog: selectedBlog
}, function (data) {
$("#delete_select_post").remove();
$("#delete_select_post_info").remove();
$("#delete_post_button").remove();
$("#delete_get_posts").after("<p id='delete_select_post'></p>");
$("#delete_get_posts").after(
"<p id='delete_select_post_info'>" +
"Now select the post you want to delete. " +
"Remember that once a post is deleted it can't be restored.</p>"
);
$("#delete_select_post").append(
"<select id='delete_selected_post'></select>"
);
$.each($.parseJSON(data), function (index, value) {
var post = value.substring(0, value.length - 3);
$("#delete_selected_post").append(
"<option value='" + post + "'>" + post + "</option>"
);
});
$("#delete_select_post").after(
"<a class='button' id='delete_post_button' " +
"onclick='deletePostButton()'>DELETE POST</a>"
);
});
});
}
/**
* Delete the selected posts
*/
function deletePostButton() {
var selectedBlog = $("#delete_selected_blog").val();
var selectedPost = $("#delete_selected_post").val();
$.get("res/delete_post.php", {
blog: selectedBlog,
post: selectedPost
}, function (data) {
$("#delete_select_post").remove();
$("#delete_select_post_info").remove();
$("#delete_post_button").remove();
if (data == "901") {
alert("ERROR 901: No post as get argument given.");
} else if (data == "921") {
alert("ERROR 921: No post with given argument available.");
} else if (data == "941") {
alert("ERROR 941: No blog as get argument given");
} else if (data == "961") {
alert(
"ERROR 961: Error while deleting the file. Check if the" +
"web server has the permission to do so."
);
} else if (data == "0") {
alert("Post successfully deleted.");
}
});
}
$(document).ready(main());

61
rcc/res/delete_post.php Normal file
View file

@ -0,0 +1,61 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* delete post script
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Error Codes:
* 901 No post given as get argument
* 921 No post with the given name available
* 941 No blog given as get argument
* 961 Error while deleting the post
*/
$post = $_GET["post"];
$blog = $_GET["blog"];
session_start();
if ($_SESSION['login']) {
if (!isset($post)) {
echo "901";
} else if (!isset($blog)) {
echo "941";
} else if (!file_exists("./../../articles/$blog/$post.md")) {
echo "921";
} else {
if (unlink("./../../articles/$blog/$post.md")) {
echo "0";
}
echo "961";
}
}
?>

85
rcc/res/edit.js Normal file
View file

@ -0,0 +1,85 @@
/**
* JavaScript for the ajax request to edit a article
*
* Copyright (c) 2016 by mmk2410
* License: MIT License
*/
function main() {
// listener and function for recieving the posts of the selected blogs
$("#edit_get_posts").click(function () {
var selectedBlog = $("#edit_selected_blog").val();
$.get("res/get_posts.php", {
blog: selectedBlog
}, function (data) {
$("#edit_select_post").remove();
$("#edit_select_post_info").remove();
$("#edit_post_button").remove();
$("#edit_get_posts").after("<p id='edit_select_post'></p>");
$("#edit_get_posts").after(
"<p id='edit_select_post_info'>" +
"Now select the post you want to edit.</p>"
);
$("#edit_select_post").append(
"<select id='edit_selected_post'></select>"
);
$.each($.parseJSON(data), function (index, value) {
var post = value.substring(0, value.length - 3);
$("#edit_selected_post").append(
"<option value='" + post + "'>" + post + "</option>"
);
});
$("#edit_select_post").after(
"<a class='button' id='edit_post_button' " +
"onclick='editPostButton()'>EDIT POST</a>"
);
});
});
$("#save_changes").click(function () {
var postTitle = $("#title").val();
var postDate = $("#date").val();
var postAuthor = $("#author").val();
var postTags = $("#tags").val();
var postText = $("#text").val();
var file = "../../articles/" + getVariables.blog +
"/" + getVariables.post + ".md";
$.post("../res/save.php", {
title: postTitle,
date: postDate,
author: postAuthor,
tags: postTags,
text: postText,
file: file
}, function (data) {
if (data == "0") {
alert("File successfully changed.");
window.open("../");
} else if (data == "1") {
alert("Error while saving the changes.");
} else if (data == "-1") {
alert("file");
}
});
});
}
/**
* Delete the selected posts
*/
function editPostButton() {
var selectedBlog = $("#edit_selected_blog").val();
var selectedPost = $("#edit_selected_post").val();
var href = "./edit/?blog=" + selectedBlog + "&post=" + selectedPost;
window.open(href);
}
$(document).ready(main());

58
rcc/res/get_posts.php Normal file
View file

@ -0,0 +1,58 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* get post script
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Error Codes:
* 901 No blog given as get argument
* 921 No blog with the given name available
*/
session_start();
if ($_SESSION['login']) {
$blog = $_GET["blog"];
if (!isset($blog)) {
echo "901";
} else if (!file_exists("./../../blogs/$blog.md")) {
echo "921";
} else {
$posts = array();
$i = 0;
foreach (scandir("./../../articles/$blog/") as $article) {
if (substr($article, -3) == ".md") {
$posts[$i] = $article;
$i++;
}
}
print json_encode($posts);
}
}

View file

@ -1,30 +1,29 @@
/*
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 14, 2015, 6:13:38 PM
Author : mmk2410
*/
* RCC cascade style sheet
*
* Copyright (C) 2015-2016 Marcel Kapfer (mmk2410)
* MIT License
*
* The MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/* BODY */
@ -38,19 +37,19 @@ body{
.main{
height: 100%;
width: 100%;
margin-left: 0px;
margin-left: 0;
}
/* HEADER */
.header{
background-color: #ff4415;
position: fixed;
top: 0px;
right: 0px;
left: 0px;
top: 0;
right: 0;
left: 0;
width: 100%;
height: 64px;
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45);
box-shadow: 2px 0 2px 2px rgba(62, 62, 62, 0.45);
}
.title{
@ -63,6 +62,16 @@ body{
position: absolute;
}
.back {
color: #fff;
font-size: 18px;
text-decoration: none;
line-height: 64px;
vertical-align: middle;
right: 75px;
position: absolute;
}
/* MAIN */
.card{
@ -72,7 +81,7 @@ body{
background: #fff;
border-radius: 2px;
padding: 24px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
margin-bottom: 40px;
max-width: 1160px;
}
@ -87,6 +96,15 @@ body{
border-bottom: none!important;
}
.subheadline {
font-size: 20px;
color: #383838 !important;
text-decoration: none;
display: block;
padding-bottom: 6px;
border-bottom: none !important;
}
.card > p{
font-size: 14px;
line-height: 24px;
@ -126,9 +144,9 @@ body{
border-width: 1px;
border-style: solid;
border-color: #ff4415;
box-shadow: 0.4px 1px 1.5px 1px #aaa;
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
box-shadow: 0.4px 1px 1.5px 1px #aaa;
border-radius: 2px;
margin-top: 4px;
margin-bottom: 5px;
@ -139,6 +157,10 @@ body{
transition-delay: 50ms;
transition-duration: 125ms;
transition-timing-function: ease;
-o-transition-property: box-shadow;
-o-transition-delay: 50ms;
-o-transition-duration: 125ms;
-o-transition-timing-function: ease;
-moz-transition-property: box-shadow;
-moz-transition-delay: 50ms;
-moz-transition-duration: 125ms;
@ -151,12 +173,13 @@ body{
}
.button:hover, .button:hover {
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa; }
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
}
input.button{
padding: 0px 8px;
padding: 0 8px;
}
/* INPUT FIELD */
@ -166,11 +189,17 @@ input.button{
border-width: 1px;
font-size: 16px;
line-height: 22px;
width: 400px;
max-width: 100%;
border-bottom-color: #aaa;
transition-property: border-bottom-color;
transition-delay: 50ms;
transition-duration: 125ms;
transition-timing-function: ease;
-o-transition-property: border-bottom-color;
-o-transition-delay: 50ms;
-o-transition-duration: 125ms;
-o-transition-timing-function: ease;
-moz-transition-property: border-bottom-color;
-moz-transition-delay: 50ms;
-moz-transition-duration: 125ms;
@ -187,6 +216,42 @@ input.button{
outline: none;
}
/* TEXTAREA */
.itextarea {
border-color: transparent;
border-width: 1px;
font-size: 16px;
line-height: 22px;
height: auto;
resize: none;
min-height: 100px;
width: calc(100% - 10px);
border-bottom-color: #aaa;
transition-property: border-bottom-color;
transition-delay: 50ms;
transition-duration: 125ms;
transition-timing-function: ease;
-o-transition-property: border-bottom-color;
-o-transition-delay: 50ms;
-o-transition-duration: 125ms;
-o-transition-timing-function: ease;
-moz-transition-property: border-bottom-color;
-moz-transition-delay: 50ms;
-moz-transition-duration: 125ms;
-moz-transition-timing-function: ease;
-webkit-transition-property: border-bottom-color;
-webkit-transition-delay: 50ms;
-webkit-transition-duration: 125ms;
-webkit-transition-timing-function: ease;
}
.itextarea:focus {
border-bottom-color: #ff4415;
border-width: 2px;
outline: none;
}
/* FORM */
form{
margin-top: 20px;
@ -210,4 +275,14 @@ form{
left: 25px;
}
}
.back {
display: none;
}
}
@media screen and (min-width: 721px) {
#back-card {
display: none;
}
}

32
rcc/res/rcc.js Normal file
View file

@ -0,0 +1,32 @@
/**
* JavaScript for RCC
*
* Copyright (c) 2016 by mmk2410
* License: MIT License
*/
window.onload = function () {
var t = document.getElementsByTagName('textarea')[0];
var offset = !window.opera ? (t.offsetHeight - t.clientHeight) : (
t.offsetHeight + parseInt(
window.getComputedStyle(t, null).getPropertyValue('border-top-width')
)
);
/**
* The following three code clocks are for proper resizing of the input
* textarea
*/
var resize = function (t) {
t.style.height = 'auto';
t.style.height = (t.scrollHeight + offset ) + 'px';
};
t.addEventListener && t.addEventListener('input', function (event) {
resize(t);
});
t.attachEvent && t.attachEvent('onkeyup', function () {
resize(t);
});
};

58
rcc/res/save.php Normal file
View file

@ -0,0 +1,58 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
session_start();
if ($_SESSION['login']) {
$title = $_POST["title"];
$date = $_POST["date"];
$author = $_POST["author"];
$tags = $_POST["tags"];
$text = $_POST["text"];
$filename = $_POST["file"];
$md = <<<EOD
%TITLE: $title
%DATE: $date
%AUTHOR: $author
%TAGS: $tags
$text
EOD;
if (file_put_contents($filename, $md)) {
echo 0;
} else if (file_exists(($filename))) {
echo 1;
} else {
echo -1;
}
}

11
rcc/ssl.php Normal file
View file

@ -0,0 +1,11 @@
<?php
// Marcel Kapfer (mmk2410) / Wilson O'Sullivan
// License: MIT License
// SSL Verification
if (isset($settings["rcc"]["debug"]) && $settings["rcc"]["debug"] != "on") {
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") {
header('HTTP/1.1 400 Bad Request');
exit();
}
}

View file

@ -1,57 +1,102 @@
<?php
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* Main page of RCC (Rangitaki Control Center)
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
?>
<!DOCTYPE html>
<!--
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<html>
<head>
<meta charset="UTF-8">
<title>Rangitaki Control Center</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<link rel="stylesheet" href="../res/rcc.css" />
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">File Upload</div>
<?php
if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>";
} else {
$blog = filter_input(INPUT_POST, "blog");
$uploaddir = "../..//articles/$blog/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
<head>
<meta charset="UTF-8">
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "<p>The post was successfully uploaded and is now published.</p>";
} else {
echo "<p>During the uploading process an error occured! <br> Error Code:" . ($_FILES['userfile']['error'] . "</p>");
}
}
?>
</section>
</div>
</body>
<title>Rangitaki Control Center</title>
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0" name="viewport"/>
<meta name="theme-color" content="#383838">
<meta name="description" content="Rangitaki Control Center (RCC)">
<link rel="stylesheet" href="./res/rcc.css"/>
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
400italic,100,100italic,900' rel='stylesheet'
type='text/css'> <!--Font-->
</head>
<body>
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<section class="card">
<div class="headline">File Upload</div>
<?php
session_start();
if ($_SESSION['login']) {
if ($_FILES['userfile']['name'] == "") {
echo "<p>You have to choose a file!</p>";
} else {
$blog = filter_input(INPUT_POST, "blog");
$uploaddir = "../..//articles/$blog/";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo
"<p>The post was successfully uploaded and is now
published.</p>";
} else {
echo
"<p>During the uploading process an error occured! <br>
Error Code:"
. ($_FILES['userfile']['error'] . "</p>");
}
}
?>
<a href="../" class="button">GO BACK</a>
<?php
}
?>
</section>
</div>
</body>
</html>

View file

@ -10,6 +10,7 @@
color: #333333;
overflow-x: auto;
-webkit-text-size-adjust: none;
-ms-text-size-adjust: none;
}
.hljs-comment,

View file

@ -1,52 +1,3 @@
/*
The MIT License
.nav{display:none}.nav-img{display:none}@media screen and (min-width: 1440px){.header{left:0}.main{margin-left:0;width:100%}}@media screen and (max-width: 720px){.title{left:25px}}
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 7:07:45 PM
Author : mmk2410
*/
.nav{
display: none;
}
.nav-img{
display: none;
}
@media screen and (min-width: 1440px) {
.header {
left: 0px;
}
.main{
margin-left: 0px;
width: 100%;
}
}
@media screen and (max-width: 720px){
.title{
left: 25px;
}
}
/*# sourceMappingURL=no-nav.css.map */

1
res/css/no-nav.css.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"no-nav.css","sources":["no-nav.sass"],"sourcesContent":["/*\n * Rangitaki Project\n *\n * The MIT License\n *\n * Copyright 2015 mmk2410.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * A stylesheet for overriding the default styles if the navigation drawer is disabled\n */\n\n.nav {\n display: none; }\n\n.nav-img {\n display: none; }\n\n@media screen and (min-width: 1440px) {\n .header {\n left: 0; }\n\n .main {\n margin-left: 0;\n width: 100%; } }\n\n@media screen and (max-width: 720px) {\n\n .title {\n left: 25px; } }\n"],"mappings":"AA4BA,AAAA,IAAI,AAAC,CACD,OAAO,CAAE,IAAK,CAAG,AAErB,AAAA,QAAQ,AAAC,CACL,OAAO,CAAE,IAAK,CAAG,AAErB,MAAM,CAAN,MAAM,MAAM,SAAS,EAAE,MAAM,EACzB,AAAA,OAAO,AAAC,CACJ,IAAI,CAAE,CAAE,CAAG,AAEf,AAAA,KAAK,AAAC,CACF,WAAW,CAAE,CAAE,CACf,KAAK,CAAE,IAAK,CAAG,CAEvB,MAAM,CAAN,MAAM,MAAM,SAAS,EAAE,KAAK,EAExB,AAAA,MAAM,AAAC,CACH,IAAI,CAAE,IAAK,CAAG","names":[]}

View file

@ -1,246 +1,3 @@
/*
The MIT License
body{margin-top:94px}.main{height:100%;margin-left:0}.overlay{opacity:0;position:fixed;top:0;left:0;background-color:black;width:100%;z-index:30;height:100%;display:none}.header{top:0;right:0;left:0;width:100%;height:64px;position:absolute}.title{color:#fff;font-size:23px;text-decoration:none;line-height:64px;vertical-align:middle;left:75px}.title>a{text-decoration:none;color:#fff}.fadeout{position:absolute;height:64px;top:0;right:0;width:40px}.nav-img{height:26px;padding:19px;cursor:pointer}.nav{width:300px;position:fixed;height:100%;top:0;left:-301px;z-index:40}.nav-item,.nav-item-static{text-decoration:none;text-indent:0;display:inline-block;height:48px;vertical-align:middle;width:284px;line-height:48px;padding-left:16px;transition:background-color 125ms ease-in-out 0ms}.nav-close{cursor:pointer}.nav-close-img{height:35px;padding:12px}.nav-item{cursor:pointer}.divider{width:100%}.card{margin-right:auto;margin-left:auto;width:75%;padding:24px;margin-bottom:40px;max-width:1160px}.card a{-moz-hyphens:auto;-epub-hyphens:auto;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;word-wrap:break-word}.headline{display:block;padding-bottom:8px}.card img{max-width:100%;max-height:400px;display:block;margin-left:auto;margin-right:auto}.author{display:block}.readmore{padding:12px 0 25px 0}.fabmenu{position:fixed;bottom:20px;right:20px}.fab{height:60px;width:60px;border-radius:30px;cursor:pointer}.fab-img{width:28px;padding:15px}.subfab{height:45px;width:45px;border-radius:30px;margin-right:auto;margin-left:auto;margin-bottom:25px;display:none}.subfab-img{width:22px;padding:12px}.pag_buttons{margin-right:auto;margin-left:auto;width:calc(75% + 48px);margin-bottom:80px;max-width:1160px;text-align:right}.button{text-decoration:none;color:#fff;line-height:36px;min-width:64px;text-align:center;height:36px;padding:8px;margin-top:4px;margin-bottom:5px;cursor:pointer}.pag_next{margin-left:8px}.footer a{transition:border-bottom-color 150ms ease-in-out 100ms}.footer a:hover{border-bottom-color:#383838}@media screen and (min-width: 1440px){.nav{left:0;padding-top:64px}.nav-close-img{display:none}.nav-close{display:none}.nav-img{display:none}.header{left:300px}.main{margin-left:300px;width:calc(100% - 300px)}}@media screen and (max-width: 720px){.card{width:82%}.pag_buttons{width:calc(82% + 48px)}}
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 14, 2015, 6:13:38 PM
Author : mmk2410
*/
/* BODY */
body{
margin-top: 94px;
}
.main{
height: 100%;
margin-left: 0px;
}
.overlay {
opacity: 0;
position: fixed;
top: 0;
left: 0;
background-color: black;
width: 100%;
z-index: 30;
height: 100%;
display: none;
}
/* HEADER */
.header{
top: 0px;
right: 0px;
left: 0px;
width: 100%;
height: 64px;
position: absolute;
}
.title{
color: #fff;
font-size: 23px;
text-decoration: none;
line-height: 64px;
vertical-align: middle;
left: 75px;
}
.title > a{
text-decoration: none;
color: #fff;
}
.fadeout{
position: absolute;
height: 64px;
top: 0px;
right: 0px;
width: 40px;
}
.nav-img{
height: 26px;
padding: 19px;
cursor: pointer;
}
/* NAV DRAWER */
.nav{
width: 300px;
position: fixed;
height: 100%;
top: 0px;
left: -300px;
padding-top: 64px;
z-index: 40;
}
.nav-item, .nav-item-static{
text-decoration: none;
text-indent: 0;
display: inline-block;
height: 48px;
text-decoration: none;
vertical-align: middle;
width: 284px;
line-height: 48px;
padding-left: 16px;
transition: background-color 125ms ease-in-out 0ms;
}
.nav-item{
cursor: pointer;
}
.divider{
width: 100%;
}
/* MAIN */
.card{
margin-right: auto;
margin-left: auto;
width: 75%;
padding: 24px;
margin-bottom: 40px;
max-width: 1160px;
}
.card a{
}
.card a:hover{
}
.headline{
display: block;
padding-bottom: 8px;
}
.card img{
max-width: 100%;
max-height: 400px;
}
.date{
}
.articletext{
}
.author{
display: block;
}
.tag{
}
/* FAB */
.fabmenu{
position: fixed;
bottom: 20px;
right: 20px;
}
.fab{
height: 60px;
width: 60px;
border-radius: 30px;
cursor: pointer;
}
.fab-img{
width: 28px;
padding: 15px;
}
.subfab{
height: 45px;
width: 45px;
border-radius: 30px;
margin-right: auto;
margin-left: auto;
margin-bottom: 25px;
display: none;
}
.subfab-img{
width: 22px;
padding: 12px;
}
/* FOOTER */
.footer{
}
.footer a{
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.footer a:hover{
border-bottom-color: #383838;
}
@media screen and (min-width: 1440px) {
.nav{
left: 0px;
}
.nav-img{
display: none;
}
.header{
left: 300px;
}
.main{
margin-left: 300px;
width: calc(100% - 300px);
}
}
@media screen and (max-width: 720px){
.card{
width: 82%;
}
}
/*# sourceMappingURL=rangitaki.css.map */

File diff suppressed because one or more lines are too long

60
res/img/close-dark.svg Normal file
View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
fill="#000000"
height="48"
viewBox="0 0 24 24"
width="48"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="close-dark.svg">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3830"
inkscape:window-height="2074"
id="namedview8"
showgrid="false"
inkscape:zoom="13.906433"
inkscape:cx="-29.993443"
inkscape:cy="32.765779"
inkscape:window-x="0"
inkscape:window-y="81"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<path
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
id="path4"
style="fill:#565656;fill-opacity:1" />
<path
d="M0 0h24v24H0z"
fill="none"
id="path6" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -1,85 +1 @@
/*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
var main = function () {
var fabActive = false;
$('.fabmenu').click(function () {
if (!(fabActive)) {
fabFadeIn();
fabActive = true;
} else {
fabFadeOut();
fabActive = false;
}
});
var navOpen = false;
$('.nav-img, .overlay').click(function () {
if (!(navOpen)) {
openNav();
navOpen = true;
} else {
closeNav();
navOpen = false;
}
});
};
$(document).ready(main);
function goBack() {
history.go(-1);
}
function fabFadeIn() {
$('.subfab').fadeIn(125);
$('.fab-img').fadeOut(60, function callback() {
$('.fab-img').attr("src", "./res/img/close.svg");
});
$('.fab-img').fadeIn(60);
}
function fabFadeOut() {
$('.subfab').fadeOut(125);
$('.fab-img').fadeOut(60, function callback() {
$('.fab-img').attr("src", "./res/img/share.svg");
});
$('.fab-img').fadeIn(60);
}
function openNav() {
$('.nav').animate({"left": "0px"}, 125);
$('.overlay').show();
$('.overlay').animate({"opacity": "0.4"}, 125);
}
function closeNav() {
$('.nav').animate({"left": "-300px"}, 125);
$('.overlay').animate({"opacity": "0.0"}, 125, function () {
$('.overlay').hide();
});
}
(function(){var n,t,a,e,r;e=function(){var e,i;return e=!1,$(".fabmenu").click(function(){return e?(a(),e=!1):(t(),e=!0)}),i=!1,$(".nav-img, .overlay, .nav-close").click(function(){return i?(n(),i=!1):(r(),i=!0)}),$(document).keyup(function(t){return i&&27===t.which?(n(),i=!1):i||77!==t.which?void 0:(r(),i=!0)}),$(".articletext a").attr("target","_blank")},$(document).ready(e),t=function(){return $(".subfab").fadeIn(125),$(".fab-img").fadeOut(60,function(){return $(".fab-img").attr("src","./res/img/close.svg"),$(".fab-img").fadeIn(60)})},a=function(){return $(".subfab").fadeOut(125),$(".fab-img").fadeOut(60,function(){return $(".fab-img").attr("src","./res/img/share.svg"),$(".fab-img").fadeIn(60)})},r=function(){return $(".nav").animate({left:"0px"},125),$(".overlay").show(),$(".overlay").animate({opacity:"0.4"},125)},n=function(){return $(".nav").animate({left:"-301px"},125),$(".overlay").animate({opacity:"0.0"},125,function(){return $(".overlay").css({display:"none"})})}}).call(this);

View file

@ -1,6 +1,17 @@
<?php
/*
/**
* PHP Version 7
*
* Since there is no initialize function, I recommend to use the short access syntay
*
* @category Articles
* @package RangitakiPHP
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*
* Rangitaki Project
*
* The MIT License
*
* Copyright 2015 mmk2410.
@ -25,90 +36,306 @@
*/
/**
* Description of ArticleGenerator
* The article generator class is a collection of functions for generating the
* article of markdown
*
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
* Since there is no initialize function, I recommend to use the short access syntay
*
* @category Articles
* @package RangitakiPHP
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*/
class ArticleGenerator {
class ArticleGenerator
{
function newArticle ($directory, $articlefile, $blog) {
/**
* A function to create one new article
*
* @param string $directory The directory where the article files are stored
* @param string $articlefile The name of the article file
* @param string $blog The name of the current blog
*
* @return Null
*/
function newArticle($directory, $articlefile, $blog, $excerpt, $readmore)
{
$article = file_get_contents($directory . $articlefile);
$article = file_get_contents($directory . $articlefile); // get the file
echo "<section class='card'>";
if (substr($article, 0, 6) == "%TITLE") {
$title = substr($article, 8, strpos($article, "\n") - 8);
if ($blog == "") {
$link = "./?article=" . substr($articlefile, 0, -3);
} else {
$link = "./?blog=$blog&article=" . substr($articlefile, 0, -3);
if (substr($article, 0, 6) == "%TITLE") { // if a title is in the first line
$title = substr($article, 8, strpos($article, "\n") - 8); // get this title
if ($blog == "") { // if one main blog
$link = "./?article=" . substr($articlefile, 0, -3); // create link to article
} else { // if not on main blog
$link = "./?blog=$blog&article=" . substr($articlefile, 0, -3); // create link to article at specific blog
}
echo "<a href='$link' class='headline'>$title</a>";
$article = substr($article, strpos($article, "\n") + 1);
echo "<a href='$link' class='headline'>$title</a>"; // print link (as a headline)
$article = substr($article, strpos($article, "\n") + 1); // remove title tag from $article (the variable, not the document)
}
if (substr($article, 0, 5) == "%DATE") {
$date = substr($article, 7, strpos($article, "\n") - 7);
echo "<span class='date'>$date</span>";
$article = substr($article, strpos($article, "\n") + 1);
if (substr($article, 0, 5) == "%DATE") { // if now a date is in the first line
$date = substr($article, 7, strpos($article, "\n") - 7); // get this date
echo "<span class='date'>$date</span>"; // print the date
$article = substr($article, strpos($article, "\n") + 1); // remove this line
}
if (substr($article, 0, 7) == "%AUTHOR") {
$author = substr($article, 9, strpos($article, "\n") - 9);
$article = substr($article, strpos($article, "\n") + 1);
if (substr($article, 0, 7) == "%AUTHOR") { // if a author is now in the first line
$author = substr($article, 9, strpos($article, "\n") - 9); // get the author
$article = substr($article, strpos($article, "\n") + 1); // remove the line
}
if (substr($article, 0, 5) == "%TAGS") {
$tags = substr($article, 7, strpos($article, "\n") - 7);
$tags = explode(", ", $tags);
$article = substr($article, strpos($article, "\n") + 1);
if (substr($article, 0, 5) == "%TAGS") { // if tags are now at the beginning
$tags = substr($article, 7, strpos($article, "\n") - 7); // get tags
$tags = explode(", ", $tags); // split them into an array
$article = substr($article, strpos($article, "\n") + 1); // remove this line
}
//TODO Code detection
echo "<div class='articletext'>";
// print only a excerpt of the post
// with at least 200 characters if possible.
if ( $excerpt == 'on' ) {
$emptyline = strpos($article, "\n\n");
if ( $emptyline !== false ) {
if ( $emptyline < 200) {
$emptyline2 = strpos($article, "\n\n", $emptyline);
if ( $emptyline2 !== false ) {
$article = substr($article, 0, $emptyline2);
} else {
$article = substr($article, 0, $emptyline);
}
} else {
$article = substr($article, 0, $emptyline);
}
} else {
// correct $excerpt for use in line 127.
$excerpt = 'off';
}
}
echo Parsedown::instance()
->setBreaksEnabled(true)
->text($article);
->text($article); // print now the article text as html
echo "</div>";
if ($author != "") {
echo "<span class='author'>$author</span>";
if ( $excerpt == 'on' ) {
echo "<div class='readmore'><a href='$link'>$readmore</a></div>";
}
foreach ($tags as $tag) {
$blogurl = filter_input(INPUT_GET, "blog");
if ($blogurl == "") {
echo "<a class='tag' href='./?tag=$tag'>$tag</a> ";
} else {
echo "<a class='tag' href='./?blog=$blog&tag=$tag'>$tag</a> ";
if (isset($author)) {
echo "<span class='author'>$author</span>"; // print the author
}
if (isset($tags)) {
foreach ($tags as $tag) {
$blogurl = filter_input(INPUT_GET, "blog");
if ($blogurl == "") { // on main blog. no ?blog=
echo "<a class='tag' href='./?tag=$tag'>$tag</a> ";
} else { // not on main blog
echo "<a class='tag' href='./?blog=$blog&tag=$tag'>$tag</a> ";
}
}
}
echo "</section>" . "\n";
}
function getTags($directory, $articlefile) {
$article = file_get_contents($directory . $articlefile);
if (substr($article, 0, 6) == "%TITLE") {
/**
* A function to get an articles tags as an array
*
* @param string $directory The directory where the article files are stored
* @param string $articlefile The name of the article file
* @return array
*/
static function getTags($directory, $articlefile)
{
$article = file_get_contents($directory . $articlefile); // get the article
if (substr($article, 0, 6) == "%TITLE") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%DATE") {
if (substr($article, 0, 5) == "%DATE") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 7) == "%AUTHOR") {
if (substr($article, 0, 7) == "%AUTHOR") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%TAGS") {
$tags = substr($article, 7, strpos($article, "\n") - 7);
$tags = explode(", ", $tags);
if (substr($article, 0, 5) == "%TAGS") { // detect the tags
$tags = substr($article, 7, strpos($article, "\n") - 7); // get the tags
$tags = explode(", ", $tags); // split them into an array
}
return $tags;
return $tags; // remove that array
}
/**
* A function to get an article title as a string
*
* @param string $directory The directory where the article files are stored
* @param string $articlefile The name of the article file
* @return string
*/
static function getTitle($directory, $articlefile)
{
$article = file_get_contents($directory . $articlefile); // get the article
if (substr($article, 0, 6) == "%TITLE") { // detect and remove the title
$title = substr($article, 8, strpos($article, "\n") - 8); // get this title
return $title; // remove that array
}
}
/**
* A function to get the date of an article
*
* @param $directory The directory where the article is stored
* @param $articlefile The name of the article file
* @return string
*/
static function getDate($directory, $articlefile)
{
$article = file_get_contents($directory . $articlefile);
if (substr($article, 0, 6) == "%TITLE") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%DATE") { // detect and remove the title
$date = substr($article, 7, strpos($article, "\n") - 7);
return $date;
}
}
/**
* A function to get a short summary of a text
*
* @param $directory The directory where the article is stored
* @param $articlefile The name of the article file
*
* @return string
*/
static function getSummary($directory, $articlefile)
{
$text = ArticleGenerator::getText($directory, $articlefile);
$pos = stripos($text, "\n\n");
if ($pos !== false) {
$offset = $pos;
$pos = stripos($text, ".", $offset);
$summary = substr($text, 0, $pos) . ".";
return trim($summary);
} else {
return $text;
}
}
/**
* A function to get the author of an article
*
* @param $directory The directory where the article is stored
* @param $articlefile The name of the article file
* @return string
*/
static function getAuthor($directory, $articlefile)
{
$article = file_get_contents($directory . $articlefile);
if (substr($article, 0, 6) == "%TITLE") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%DATE") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 7) == "%AUTHOR") { // detect and remove the title
$author = substr($article, 9, strpos($article, "\n") - 9);
return $author;
}
}
/**
* A function to get the text of an article
*
* @param $directory The directory where the article is stored
* @param $articlefile The name of the article file
* @return string
*/
static function getText($directory, $articlefile)
{
$article = file_get_contents($directory . $articlefile);
if (substr($article, 0, 6) == "%TITLE") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%DATE") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 7) == "%AUTHOR") { // detect and remove the title
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%TAGS") { // detect the tags
$article = substr($article, strpos($article, "\n") + 1); // remove the tags
}
return $article;
}
/**
* A function to get a array of the article
*
* @param $directory The directory where the article is stored
* @param $articlefile The name of the article file
* @return string
*/
public function getArray($directory, $articlefile)
{
$article = file_get_contents($directory . $articlefile);
$title = "";
$date = "";
$author = "";
$tags = array();
if (substr($article, 0, 6) == "%TITLE") { // get and remove the title
$title = substr($article, 8, strpos($article, "\n") - 8);
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%DATE") { // get and remove the title
$date = substr($article, 7, strpos($article, "\n") - 7);
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 7) == "%AUTHOR") { // get and remove the title
$author = substr($article, 9, strpos($article, "\n") - 9);
$article = substr($article, strpos($article, "\n") + 1);
}
if (substr($article, 0, 5) == "%TAGS") { // get and remove the tags
$tags = substr($article, 7, strpos($article, "\n") - 7); // get the tags
$tags = explode(", ", $tags); // split them into an array
$article = substr($article, strpos($article, "\n") + 1);
}
$data = array(
"title" => $title,
"date" => $date,
"author" => $author,
"tags" => $tags,
"text" => $article
);
return $data;
}
}

View file

@ -1,57 +1,137 @@
<?php
/*
* The MIT License
/**
* PHP Version 7
*
* Copyright 2015 mmk2410.
* Rangitaki Project
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* @category Blogs
* @package RangitakiPHP
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*/
namespace mmk2410\rbe\BlogListGenerator;
/**
* Description of BlogListGenerator
* The blog list generator class is a collection of functions for generating
* blog list
* or getting informations about them
*
* @author mmk2410 <marcelmichaelkapfer@yahoo.co.nz>
* Since there is no initialize function, I recommend to use the short
* access syntay
*
* @category Generator
* @package Rbe
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*/
class BlogListGenerator {
function listBlog($directory, $blogname, $blogmaintitle) {
class BlogListGenerator
{
/**
* A function to generate a blog nav item
*
* @param string $directory The directory of the blog file
* @param string $blogname The name of the blog file
* @param string $blogmaintitle The name of the main blog
*
* @return None
*/
public function listBlog($directory, $blogname, $blogmaintitle)
{
// get content of the blog file;
$blog = file_get_contents($directory . $blogname);
// add a line break as a security measurement
$blog = $blog . "\n";
// check if the first line includes a title
if (substr($blog, 0, 6) == "%TITLE") {
$blog = substr($blog, 8, strpos($blog, "\n") - 8);
if ($blog == "main") {
echo "<a class='nav-item' href='./'>$blogmaintitle</a>";
// grab the title
$itemname = substr($blog, 8, strpos($blog, "\n") - 8);
// if on main blog
if ($itemname == "main") {
// create a nav item to the main blog
$atag = "<a class='nav-item' href='./'>$blogmaintitle</a>";
} else {
// create a link to the blog
$link = "./?blog=" . substr($blogname, 0, -3);
echo "<a class='nav-item' href='$link'>$blog</a>";
// create a nav item to the blog
$atag = "<a class='nav-item' href='$link'>$itemname</a>";
}
$blog = substr($blog, strpos($blog, "\n") + 1);
}
// nav item as link to external page
if (substr($blog, 0, 4) == "%URL") {
$itemurl = substr($blog, 6, strpos($blog, "\n") - 6);
$atag = "<a class='nav-item' href='$itemurl'>$itemname</a>";
}
return $atag;
}
function getName($file){
/**
* A function to get the name of a blog
*
* @param string $file The path of the blog file
*
* @return string
*/
public function getName($file)
{
// get the content of the blog file
$blog = file_get_contents($file);
// add a line break as a securit measure
$blog = $blog . "\n";
if(substr($blog, 0, 6) == "%TITLE"){
// check if first line includes a title
if (substr($blog, 0, 6) == "%TITLE") {
// grab the title
$blog = substr($blog, 8, strpos($blog, "\n") - 8);
return $blog;
}
}
/**
* A function to recieve the amount of articles
* of a blog
*
* @param string $blog the blog name
*
* @return int Amount of files
*/
public static function getArticleAmount($blog)
{
$directory = "./articles/" . $blog . "/";
if (!file_exists($directory)) {
return 0;
} else {
$i = 0;
$handle = opendir($directory);
while (($file = readdir($handle)) !== false) {
if (!in_array($file, array('.','..'))) {
$i++;
}
}
return $i;
}
}
/**
* A function returning the external linkn of
* a blog.
*
* @param string $blog the blog name
* @param string $dir root directory of installation
*
* @return string link to external page else null
*/
public function getExternalLink($blog, $dir)
{
$path = $dir . "/blogs/" . $blog;
$blog = file_get_contents($path) . "\n";
if (substr($blog, 0, 6) == "%TITLE") {
$blog = substr($blog, strpos($blog, "\n") + 1);
}
if (substr($blog, 0, 4) == "%URL") {
return substr($blog, 6, strpos($blog, "\n") - 6);
}
return null;
}
}

74
res/php/Config.php Normal file
View file

@ -0,0 +1,74 @@
<?php
/**
* PHP Version 7
*
* Configuration parser for yaml configuration files
*
* @category Configuration
* @package Rbe
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*/
namespace mmk2410\rbe\config;
/**
* PHP Version 7
*
* Configuration parser for yaml configuration files
*
* @category Configuration
* @package Rbe
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*/
class Config
{
/**
* Path to yaml file
* @var string
*/
private $file;
/**
* Constructor for the Config class
*
* @param $config path to the yaml file
* @param $composer path to the composer autoload
*/
public function __construct($config, $composer)
{
$this->file = $config;
require $composer;
}
/**
* Return yaml config as PHP array
*
* @return config array
*/
public function getConfig()
{
$yaml = new \Symfony\Component\Yaml\Parser();
return $yaml->parse(file_get_contents($this->file));
}
/*
* Write array into confi*
* Write array into config file
*
* @param array config new config
*
* @return FALSE if failed to write
*/
public function writeConfig($config)
{
$dumper = new \Symfony\Component\Yaml\Dumper();
$yaml = $dumper->dump($config, 2);
return file_put_contents($this->file, $yaml);
}
}

View file

@ -22,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?php if ($blogdisqus) { ?>
<?php if ($config['blog']['disqus']) { // check if disqus is enabled ?>
<section class="card">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = '<?php echo $blogdisqus; ?>';
var disqus_shortname = '<?php echo $config['blog']['disqus']; ?>';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
@ -40,4 +40,5 @@ THE SOFTWARE.
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
</section>
<?php } ?>
<?php
} ?>

View file

@ -1,5 +1,7 @@
<?php
/*
* Rangitaki Project
*
* The MIT License
*
* Copyright 2015 mmk2410.
@ -24,9 +26,10 @@
*/
if ($bloganalytics) {
?>
<script>
if ($config["blog"]["analytics"]) { // check if google analytics is enabled
if (!($_SERVER['HTTP_DNT'] == 1)) {
?>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
@ -34,7 +37,7 @@ if ($bloganalytics) {
(i[r].q = i[r].q || []).push(arguments);
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
@ -43,8 +46,9 @@ if ($bloganalytics) {
ga('create', '<?php echo $bloganalytics; ?>', 'auto');
ga('send', 'pageview');
</script>
</script>
<?php
<?php
}
}
?>
?>

67
res/php/Pagination.php Normal file
View file

@ -0,0 +1,67 @@
<?php
/**
* PHP Version 7
*
* PHP script for creating the next / prev page links
*
* @category Pagination
* @package Rbe
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link http://marcel-kapfer.de/rangitaki
*/
require_once "BlogListGenerator.php";
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
require_once './res/php/Config.php';
$configParser = new mmk2410\rbe\config\Config('./config.yaml', './vendor/autoload.php');
$conf = $configParser->getConfig();
require_once "lang/" . $config["language"] . ".php";
if ($blog["design"]["pagination"]) {
?>
<div class="pag_buttons">
<?php
if ($pag_min > 0) {
if (isset($getblog)) {
?>
<a href="<?php
echo "?blog=" . $getblog . "&page=" . ($pagenumber - 1);
?>" class="pag_prev button"><?php echo $BLOGLANG["Previous Page"]; ?></a>
<?php
} else {
?>
<a href="<?php
echo "?page=" . ($pagenumber - 1);
?>" class="pag_prev button"><?php echo $BLOGLANG['Previous Page']; ?></a>
<?php
}
}
if (isset($getblog)) {
$pag_blog = $getblog;
} else {
$pag_blog = "main";
}
if ($pag_max < BlogListGenerator::getArticleAmount($pag_blog)) {
if (isset($getblog)) {
?>
<a href="<?php
echo "?blog=" . $getblog . "&page=" . ($pagenumber + 1);
?>" class="pag_next button"><?php echo $BLOGLANG["Next Page"]; ?></a>
<?php
} else {
?>
<a href="<?php
echo "?page=" . ($pagenumber + 1);
?>" class="pag_next button"><?php echo $BLOGLANG["Next Page"];?></a>
<?php
}
}
?>
</div>
<?php
}
?>

View file

@ -0,0 +1,38 @@
###
Rangitaki Project
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
###
###
This is a example JavaScript extension for Rangitaki
###
main = () ->
console.log """
Welcome Developer! \nYou're seeing the output of a
JavaScript extension for the Rangitaki blogging engine.
"""
$(document).ready main()

87
src/coffee/app.coffee Normal file
View file

@ -0,0 +1,87 @@
###
Rangitaki Project
The MIT License
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
###
main = () ->
# FAB
fabActive = false
$('.fabmenu').click ->
if !fabActive
fabFadeIn()
fabActive = true
else
fabFadeOut()
fabActive = false
# Navigation Drawer
navOpen = false
$('.nav-img, .overlay, .nav-close').click ->
if !navOpen
openNav()
navOpen = true
else
closeNav()
navOpen = false
###
Keyhandling for the navigation drawer.
opens the drawer on 'm' (key code: 77)
closes the drawer on 'Esc' (key code: 27)
###
$(document).keyup (e) ->
if navOpen and e.which is 27
closeNav()
navOpen = false
else if !navOpen and e.which == 77
openNav()
navOpen = true
# Make every link in articles target="_blank"
$('.articletext a').attr 'target', '_blank'
$(document).ready main
fabFadeIn = () ->
$('.subfab').fadeIn 125
$('.fab-img').fadeOut 60, ->
$('.fab-img').attr "src", "./res/img/close.svg"
$('.fab-img').fadeIn 60
fabFadeOut = () ->
$('.subfab').fadeOut 125
$('.fab-img').fadeOut 60, ->
$('.fab-img').attr "src", "./res/img/share.svg"
$('.fab-img').fadeIn 60
openNav = () ->
$('.nav').animate {"left": "0px"}, 125
$('.overlay').show()
$('.overlay').animate {"opacity": "0.4"}, 125
closeNav = () ->
$('.nav').animate {"left": "-301px"}, 125
$('.overlay').animate {"opacity": "0.0"}, 125, ->
$('.overlay').css {"display": "none"}

View file

@ -0,0 +1,179 @@
/*
* Rangitaki Project
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
body
font-family: "Roboto", sans-serif
background: #f6f6f6
color: #383838
background-image: url(//example.com/res/img/intro.svg)
background-size: cover
background-attachment: fixed
background-position: top center
background-repeat: no-repeat
.header
background-color: rgba(0, 0, 0, 0.45)
position: fixed
.title
color: #fff
position: absolute
.title > a
color: #fff
.fadeout
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0, 0, 0, 0.45) 100%)
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
background: linear-gradient(to right, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%)
.nav
background-color: #fff
border-right: 1px solid #e0e0e0
.nav-item, .nav-item-static
color: #383838
.nav-item
font-weight: 600
.nav-item:active
background-color: #e2e2e2
.divider
border-bottom: 1px solid #e0e0e0
.card
background: #fff
border-radius: 2px
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
.card a
color: #ff4415
text-decoration: none
border-bottom: 1px solid transparent
border-bottom-color: transparent
transition: border-bottom-color 150ms ease-in-out 100ms
.card a:hover
border-bottom-color: #ff4415
.headline
font-size: 24px
color: #383838!important
text-decoration: none
border-bottom: none!important
.headline:hover
color: #ff4415!important
.date
font-size: 13px
.articletext
font-size: 14px
line-height: 24px
.author
font-size: 13px
.tag
font-size: 13px
.fab
background-color: #ff4415
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
.subfab
background-color: #fff
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
.button
border-width: 1px
border-style: solid
text-transform: uppercase
-webkit-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
-moz-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
border-radius: 2px
letter-spacing: 0.4px
font-weight: 700
font-size: 14px
transition-property: box-shadow
transition-delay: 50ms
transition-duration: 125ms
transition-timing-function: ease
-o-transition-property: box-shadow
-o-transition-delay: 50ms
-o-transition-duration: 125ms
-o-transition-timing-function: ease
-moz-transition-property: box-shadow
-moz-transition-delay: 50ms
-moz-transition-duration: 125ms
-moz-transition-timing-function: ease
-webkit-transition-property: box-shadow
-webkit-transition-delay: 50ms
-webkit-transition-duration: 125ms
-webkit-transition-timing-function: ease
.button:hover, .button:hover
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
.pag_next
background-color: #ff4415
border-color: #ff4415
.pag_prev
background-color: #fff
border-color: #fff
color: #383838
.footer
font-size: 12px
text-align: center
color: #fff
text-shadow: 1px 1px rgba(55, 55, 55, 0.3)
.footer a
color: #fff
text-shadow: 1px 1px rgba(175, 175, 175, 0.3)
text-decoration: none
border-bottom: 1px solid transparent
border-bottom-color: transparent
.footer a:hover
border-bottom-color: #fff
@media screen and (min-width: 1440px)
.nav
background-color: rgba(255, 255, 255, 0.8)

View file

@ -0,0 +1,161 @@
/*
* Rangitaki Project
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
body
font-family: "Roboto", sans-serif
background: #303030
color: #fff
.header
background-color: #212121
position: fixed
box-shadow: 2px 0 2px 2px rgba(32, 32, 32, 0.85)
.title
color: #fff
position: absolute
> a
color: #fff
.fadeout
background: -moz-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
/* FF3.6+
background: -webkit-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
/* Chrome10+,Safari5.1+
background: -o-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
/* Opera 11.10+
background: -ms-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #212121 100%)
/* IE10+
background: linear-gradient(to right, rgba(30, 87, 153, 0) 0%, #212121 100%)
/* W3C
.nav
background-color: #424242
border-right: 1px solid #1f1f1f
.nav-item, .nav-item-static
color: #fff
.nav-item
font-weight: 600
&:active
background-color: #383838
.divider
border-bottom: 1px solid #1f1f1f
.card
background: #424242
border-radius: 2px
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
a
color: #ff4415
text-decoration: none
border-bottom: 1px solid transparent
border-bottom-color: transparent
transition: border-bottom-color 150ms ease-in-out 100ms
&:hover
border-bottom-color: #ff4415
.headline
font-size: 24px
color: #fff !important
text-decoration: none
border-bottom: none !important
&:hover
color: #ff4415 !important
.date
font-size: 13px
.articletext
font-size: 14px
line-height: 24px
.author, .tag
font-size: 13px
.fab
background-color: #ff4415
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
.subfab
background-color: #424242
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
.button
text-transform: uppercase
border-width: 1px
border-style: solid
-webkit-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
-moz-box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
box-shadow: 0 1px 1.5px 1.5px rgba(42, 42, 42, 0.65)
border-radius: 2px
letter-spacing: 0.4px
font-weight: 700
font-size: 14px
transition-property: box-shadow
transition-delay: 50ms
transition-duration: 125ms
transition-timing-function: ease
-o-transition-property: box-shadow
-o-transition-delay: 50ms
-o-transition-duration: 125ms
-o-transition-timing-function: ease
-moz-transition-property: box-shadow
-moz-transition-delay: 50ms
-moz-transition-duration: 125ms
-moz-transition-timing-function: ease
-webkit-transition-property: box-shadow
-webkit-transition-delay: 50ms
-webkit-transition-duration: 125ms
-webkit-transition-timing-function: ease
&:hover
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85)
.pag_next
background-color: #ff4415
border-color: #ff4415
.pag_prev
background-color: #424242
border-color: #424242
color: #CCCCCC
.footer
font-size: 12px
text-align: center
color: #fff
a
color: #fff
text-decoration: none
border-bottom: 1px solid transparent
border-bottom-color: transparent
&:hover
border-bottom-color: #fff

View file

@ -0,0 +1,156 @@
/*
* Rangitaki Project
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
body
font-family: "Roboto", sans-serif
background: #f6f6f6
color: #383838
.header
background-color: #ff4415
position: fixed
box-shadow: 2px 0 2px 2px rgba(62, 62, 62, 0.45)
.title
color: #fff
position: absolute
> a
color: #fff
.fadeout
background: -moz-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
background: -webkit-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
background: -o-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
background: -ms-linear-gradient(left, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
background: linear-gradient(to right, rgba(30, 87, 153, 0) 0%, #ff4415 100%)
/* W3C
.nav
background-color: #fff
border-right: 1px solid #e0e0e0
.nav-item, .nav-item-static
color: #383838
.nav-item
font-weight: 600
&:hover, &:active
background-color: #e2e2e2
.divider
border-bottom: 1px solid #e0e0e0
.card
background: #fff
border-radius: 2px
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
a
color: #ff4415
text-decoration: none
border-bottom: 1px solid transparent
border-bottom-color: transparent
transition: border-bottom-color 150ms ease-in-out 100ms
&:hover
border-bottom-color: #ff4415
.headline
font-size: 24px
color: #383838 !important
text-decoration: none
border-bottom: none !important
&:hover
color: #ff4415 !important
.date
font-size: 13px
.articletext
font-size: 14px
line-height: 24px
.author, .tag
font-size: 13px
.fab
background-color: #ff4415
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
.subfab
background-color: #fff
box-shadow: 0 1px 1.5px 1.5px rgba(62, 62, 62, 0.3)
.button
text-transform: uppercase
border-width: 1px
border-style: solid
-webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa
-moz-box-shadow: 0.4px 1px 1.5px 1px #aaa
box-shadow: 0.4px 1px 1.5px 1px #aaa
border-radius: 2px
letter-spacing: 0.4px
font-weight: 700
font-size: 14px
transition-property: box-shadow
transition-delay: 50ms
transition-duration: 125ms
transition-timing-function: ease
-o-transition-property: box-shadow
-o-transition-delay: 50ms
-o-transition-duration: 125ms
-o-transition-timing-function: ease
-moz-transition-property: box-shadow
-moz-transition-delay: 50ms
-moz-transition-duration: 125ms
-moz-transition-timing-function: ease
-webkit-transition-property: box-shadow
-webkit-transition-delay: 50ms
-webkit-transition-duration: 125ms
-webkit-transition-timing-function: ease
&:hover
-webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa
-moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa
box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa
.pag_next
background-color: #ff4415
border-color: #ff4415
.pag_prev
background-color: #fff
border-color: #fff
color: #383838
.footer
font-size: 12px
text-align: center
a
color: #383838
text-decoration: none
border-bottom: 1px solid transparent
border-bottom-color: transparent
&:hover
border-bottom-color: #383838

View file

@ -0,0 +1,194 @@
/*
*The MIT License
*
*Copyright 2015 mmk2410.
*
*Permission is hereby granted, free of charge, to any person obtaining a copy
*of this software and associated documentation files (the "Software"), to deal
*in the Software without restriction, including without limitation the rights
*to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*copies of the Software, and to permit persons to whom the Software is
*furnished to do so, subject to the following conditions:
*
*The above copyright notice and this permission notice shall be included in
*all copies or substantial portions of the Software.
*
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*THE SOFTWARE.
/*
* Created on : Jun 18, 2015, 6:39:37 PM
* Author : mmk2410
$font: "Fira Sans", sans-serif
$background: #f0f0f0
$text-color: #383838
$primary-color: #4CAF50
$header-shadow: rgba(62, 62, 62, 0.45)
$white: #FFFFFF
$fadeout-color: rgba(30, 87, 153, 0)
$border: #e0e0e0
$active-color: #e2e2e2
$fab-shadow: rgba(62, 62, 62, 0.3)
$footer-background: #2D2D2D
body
font-family: $font
background: $background
color: $text-color
margin: 130px 0 0
::selection, ::-moz-selection
color: $background
background-color: $primary-color
.header
height: 55px
background-color: $primary-color
position: fixed
box-shadow: 2px 0 2px 2px $header-shadow
.title
line-height: 55px
color: $white
position: absolute
left: 0
margin-left: calc(20% + 24px)
> a
color: $white
text-decoration: none
.fadeout
height: 55px
background: -moz-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
background: -webkit-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
background: -o-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
background: -ms-linear-gradient(left, $fadeout-color 0%, $primary-color 100%)
background: linear-gradient(to right, $fadeout-color 0%, $primary-color 100%)
.nav-img
padding: 14px 19px
.nav
background-color: $white
border-right: 1px solid $border
.nav-item, .nav-item-static
color: $text-color
.nav-item
font-weight: 600
&:hover
color: $primary-color
&:active
background-color: $active-color
.divider
border-bottom: 1px solid $border
.card
background: none
border-radius: 0
box-shadow: none
margin: 0 20% 100px
width: auto
a
color: $primary-color
text-decoration: none
border-bottom: 1px solid transparent
transition: border-bottom-color 150ms ease-in-out 100ms
&:hover
border-bottom-color: #4CAF50
.headline
font-size: 30px
line-height: 50px
color: #383838 !important
text-decoration: none
border-bottom: none !important
&:hover
color: #4CAF50 !important
.date
font-size: 13px
.articletext
margin-top: 30px
font-size: 16px
line-height: 30px
.author, .tag
font-size: 13px
.fab
background-color: $primary-color
box-shadow: 0 1px 1.5px 1.5px $fab-shadow
.subfab
background-color: $white
box-shadow: 0 1px 1.5px 1.5px $fab-shadow
.button
color: $primary-color
border-bottom: 1px solid transparent
margin: 0
min-width: 0
padding: 0
line-height: 16px
height: 16px
transition-property: border-bottom-color
transition-delay: 50ms
transition-duration: 125ms
transition-timing-function: ease
-moz-transition-property: border-bottom-color
-moz-transition-delay: 50ms
-moz-transition-duration: 125ms
-moz-transition-timing-function: ease
-webkit-transition-property: border-bottom-color
-webkit-transition-delay: 50ms
-webkit-transition-duration: 125ms
-webkit-transition-timing-function: ease
&:hover
border-bottom-color: $primary-color
.pag_prev
float: left
.button:last-child
float: none
.footer
text-align: center
height: 60px
background-color: $footer-background
line-height: 60px
width: 100%
color: $white
a
color: $white
text-decoration: none
border-bottom: 1px solid transparent
&:hover
border-bottom-color: $white
.hljs
background: none
@media screen and (min-width: 1440px)
.title
margin-left: calc(20% - 40px)
.nav
padding-top: 55px
@media screen and (max-width: 800px)
body
margin-top: 80px
.title
margin-left: 20%
.card
margin: 0 5% 100px

46
src/sass/no-nav.sass Normal file
View file

@ -0,0 +1,46 @@
/*
* Rangitaki Project
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* A stylesheet for overriding the default styles if the navigation drawer is disabled
*/
.nav
display: none
.nav-img
display: none
@media screen and (min-width: 1440px)
.header
left: 0
.main
margin-left: 0
width: 100%
@media screen and (max-width: 720px)
.title
left: 25px

252
src/sass/rangitaki.sass Normal file
View file

@ -0,0 +1,252 @@
/*
* Rangitaki Project
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* A stylesheet for overriding the default styles if the navigation drawer is disabled
*/
/* BODY */
body
margin-top: 94px
.main
height: 100%
margin-left: 0
.overlay
opacity: 0
position: fixed
top: 0
left: 0
background-color: black
width: 100%
z-index: 30
height: 100%
display: none
/* HEADER */
.header
top: 0
right: 0
left: 0
width: 100%
height: 64px
position: absolute
.title
color: #fff
font-size: 23px
text-decoration: none
line-height: 64px
vertical-align: middle
left: 75px
.title > a
text-decoration: none
color: #fff
.fadeout
position: absolute
height: 64px
top: 0
right: 0
width: 40px
.nav-img
height: 26px
padding: 19px
cursor: pointer
/* NAV DRAWER */
.nav
width: 300px
position: fixed
height: 100%
top: 0
left: -301px
z-index: 40
.nav-item, .nav-item-static
text-decoration: none
text-indent: 0
display: inline-block
height: 48px
vertical-align: middle
width: 284px
line-height: 48px
padding-left: 16px
transition: background-color 125ms ease-in-out 0ms
.nav-close
cursor: pointer
.nav-close-img
height: 35px
padding: 12px
.nav-item
cursor: pointer
.divider
width: 100%
/* MAIN */
.card
margin-right: auto
margin-left: auto
width: 75%
padding: 24px
margin-bottom: 40px
max-width: 1160px
.card a
-moz-hyphens: auto
-epub-hyphens: auto
-ms-hyphens: auto
-webkit-hyphens: auto
hyphens: auto
word-wrap: break-word
.card a:hover
.headline
display: block
padding-bottom: 8px
.card img
max-width: 100%
max-height: 400px
display: block
margin-left: auto
margin-right: auto
.date
.articletext
.author
display: block
.tag
.readmore
padding: 12px 0 25px 0
/* FAB */
.fabmenu
position: fixed
bottom: 20px
right: 20px
.fab
height: 60px
width: 60px
border-radius: 30px
cursor: pointer
.fab-img
width: 28px
padding: 15px
.subfab
height: 45px
width: 45px
border-radius: 30px
margin-right: auto
margin-left: auto
margin-bottom: 25px
display: none
.subfab-img
width: 22px
padding: 12px
/* BUTTON */
.pag_buttons
margin-right: auto
margin-left: auto
width: calc(75% + 48px)
margin-bottom: 80px
max-width: 1160px
text-align: right
.button
text-decoration: none
color: #fff
line-height: 36px
min-width: 64px
text-align: center
height: 36px
padding: 8px
margin-top: 4px
margin-bottom: 5px
cursor: pointer
.pag_next
margin-left: 8px
/* FOOTER */
.footer
.footer a
transition: border-bottom-color 150ms ease-in-out 100ms
.footer a:hover
border-bottom-color: #383838
@media screen and (min-width: 1440px)
.nav
left: 0
padding-top: 64px
.nav-close-img
display: none
.nav-close
display: none
.nav-img
display: none
.header
left: 300px
.main
margin-left: 300px
width: calc(100% - 300px)
@media screen and (max-width: 720px)
.card
width: 82%
.pag_buttons
width: calc(82% + 48px)

View file

@ -0,0 +1,91 @@
<?php
require_once 'PHPUnit/Autoload.php';
include 'res/php/ArticleGenerator.php';
class ArticleGeneratorTest extends \PHPUnit_Framework_TestCase
{
public function testGetArray()
{
$result = [
"title" => "The Rangitaki logo 2",
"date" => "24 July 2015",
"tags" => array(
"design", "artwork", "logo",
),
"author" => "",
"text" => "
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.
",
];
$this->assertEquals(
$result,
ArticleGenerator::getArray("articles/example/", "2015-07-25-example.md")
);
}
public function testGetText()
{
$result = "
This is the official Rangitaki logo.
![The Rangitaki logo](media/example.png)
It is saved in the example blog directory.
";
$this->assertEquals(
$result,
ArticleGenerator::getText("articles/example/", "2015-07-25-example.md")
);
}
public function testGetAuthor()
{
$result = "";
$this->assertEquals(
$result,
ArticleGenerator::getAuthor("articles/example/", "2015-07-25-example.md")
);
}
public function testGetSummary()
{
$result = "This is the official Rangitaki logo.";
$this->assertEquals(
$result,
ArticleGenerator::getSummary("articles/example/", "2015-07-25-example.md")
);
}
public function testGetTags()
{
$result = [ "design", "artwork", "logo" ];
$this->assertEquals(
$result,
ArticleGenerator::getTags("articles/example/", "2015-07-25-example.md")
);
}
public function testGetDate()
{
$result = "24 July 2015";
$this->assertEquals(
$result,
ArticleGenerator::getDate("articles/example/", "2015-07-25-example.md")
);
}
public function testGetTitle()
{
$result = "The Rangitaki logo 2";
$this->assertEquals(
$result,
ArticleGenerator::getTitle("articles/example/", "2015-07-25-example.md")
);
}
}

View file

@ -0,0 +1,39 @@
<?php
use PHPUnit\Framework\TestCase;
require 'res/php/BlogListGenerator.php';
use mmk2410\rbe\BlogListGenerator\BlogListGenerator as BlogListGenerator;
class BlogListGeneratorTest extends TestCase
{
public function testListBlog()
{
$this->assertEquals("<a class='nav-item' href='./?blog=example'>Example</a>",
BlogListGenerator::listBlog("./blogs/", "example.md", "Example Blog")
);
$this->assertEquals("<a class='nav-item' href='https://mmk2410.org/rangitaki/docs/'>Docs</a>",
BlogListGenerator::listBlog("./blogs/", "external.md", "Example Blog")
);
}
public function testGetName()
{
$this->assertEquals("Example", BlogListGenerator::getName("blogs/example.md"));
}
public function testGetArticleAmount()
{
$this->assertEquals(5, BlogListGenerator::getArticleAmount("example"));
}
public function testGetExternaleLink()
{
$this->assertEquals(null,
BlogListGenerator::getExternalLink("example.md", '.')
);
$this->assertEquals("https://mmk2410.org/rangitaki/docs/",
BlogListGenerator::getExternalLink("external.md", '.')
);
}
}

83
tests/ConfigTest.php Normal file
View file

@ -0,0 +1,83 @@
<?php
namespace mmk2410\rbe\tests\config;
require_once 'PHPUnit/Autoload.php';
require 'res/php/Config.php';
use \mmk2410\rbe\config\Config as Config;
class ConfigTest extends \PHPUnit_Framework_TestCase
{
public function testGetConfig()
{
$config = [
"blog" => array(
"title" => "Example Blog",
"author" => "John",
"description" => "A short description of your blog",
"home" => "on",
"homeurl" => "../",
"homename" => "Home",
"mainname" => "",
"intro" => "on",
"disqus" => "rangitaki",
"analytics" => "",
"footer" =>
"Rangitaki 2016 <a href=\"https://gitlab.com/mmk2410/rangitaki\" target=\"blank\">\n gitlab.com/mmk2410/rangitaki</a>", "url" => "https://example.com/blog/",
),
"design" => array(
"fab" => "on",
"drawer" => "on",
"theme" => "material-light",
"pagination" => 0,
"favicon" => "http://example.com/res/img/favicon.png",
),
"rcc" => array(
"rcc" => "on",
"api" => "on",
),
"language" => "en",
];
$configParser = new Config("./config.yaml", "./vendor/autoload.php");
$this->assertEquals($config, $configParser->getConfig());
}
public function testWriteReadConfig()
{
$changedConfig = [
"blog" => array(
"title" => "Examples Blog",
"author" => "Wilson O'Sullivan",
"description" => "A long description of your blog",
"home" => "on",
"homeurl" => "../",
"homename" => "Exit",
"mainname" => "",
"intro" => "on",
"disqus" => "",
"analytics" => "",
"footer" =>
"pBlog 1102 <a href=\"https://gitlab.com/mmk2410/rangitaki\" target=\"blank\">
\n gitlab.com/mmk2410/rangitaki</a>", "url" => "https://example.com/blog/",
),
"design" => array(
"fab" => "off",
"drawer" => "off",
"theme" => "material-dark",
"pagination" => "-1",
"favicon" => "http://sample.com/res/img/favicon.png",
),
"rcc" => array(
"rcc" => "on",
"api" => "off",
),
"language" => "en",
];
$configParser = new Config("/tmp/config-test.yaml", "./vendor/autoload.php");
$configParser->writeConfig($changedConfig);
$this->assertEquals($changedConfig, $configParser->getConfig());
}
}

View file

@ -1,161 +1,3 @@
/*
The MIT License
body{font-family:"Roboto", sans-serif;background:#f6f6f6;color:#383838;background-image:url(//example.com/res/img/intro.svg);background-size:cover;background-attachment:fixed;background-position:top center;background-repeat:no-repeat}.header{background-color:rgba(0,0,0,0.45);position:fixed}.title{color:#fff;position:absolute}.title>a{color:#fff}.fadeout{background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, rgba(0,0,0,0.45) 100%)}.nav{background-color:#fff;border-right:1px solid #e0e0e0}.nav-item,.nav-item-static{color:#383838}.nav-item{font-weight:600}.nav-item:active{background-color:#e2e2e2}.divider{border-bottom:1px solid #e0e0e0}.card{background:#fff;border-radius:2px;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.card a{color:#ff4415;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#ff4415}.headline{font-size:24px;color:#383838 !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#ff4415 !important}.date{font-size:13px}.articletext{font-size:14px;line-height:24px}.author{font-size:13px}.tag{font-size:13px}.fab{background-color:#ff4415;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.subfab{background-color:#fff;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.button{border-width:1px;border-style:solid;text-transform:uppercase;-webkit-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);-moz-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);border-radius:2px;letter-spacing:0.4px;font-weight:700;font-size:14px;transition-property:box-shadow;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-o-transition-property:box-shadow;-o-transition-delay:50ms;-o-transition-duration:125ms;-o-transition-timing-function:ease;-moz-transition-property:box-shadow;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:box-shadow;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover,.button:hover{-webkit-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);-moz-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85)}.pag_next{background-color:#ff4415;border-color:#ff4415}.pag_prev{background-color:#fff;border-color:#fff;color:#383838}.footer{font-size:12px;text-align:center;color:#fff;text-shadow:1px 1px rgba(55,55,55,0.3)}.footer a{color:#fff;text-shadow:1px 1px rgba(175,175,175,0.3);text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent}.footer a:hover{border-bottom-color:#fff}@media screen and (min-width: 1440px){.nav{background-color:rgba(255,255,255,0.8)}}
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 6:39:37 PM
Author : mmk2410
*/
body{
font-family: "Roboto", sans-serif;
background: #f6f6f6;
color: #383838;
background-image: url(//marcel-kapfer.de/res/img/druck.png);
background-size: cover;
background-attachment: fixed;
background-position: top center;
background-repeat: no-repeat;
}
.header{
background-color: rgba(0, 0, 0, 0.45);
position: fixed;
}
.title{
color: #fff;
position: absolute;
}
.title > a{
color: #fff;
}
.fadeout{
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, rgba(0, 0, 0, 0.45) 100%); /* FF3.6+ */
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(30,87,153,0) 0%,rgba(0, 0, 0, 0.45) 100%); /* W3C */
}
.nav{
background-color: #fff;
border-right: 1px solid #e0e0e0;
}
.nav-item, .nav-item-static{
color: #383838;
}
.nav-item{
font-weight: 600;
}
.nav-item:active{
background-color: #e2e2e2;
}
.divider{
border-bottom: 1px solid #e0e0e0;
}
.card{
background: #fff;
border-radius: 2px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.card a{
color: #ff4415;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.card a:hover{
border-bottom-color: #ff4415;
}
.headline{
font-size: 24px;
color: #383838!important;
text-decoration: none;
border-bottom: none!important;
}
.date{
font-size: 13px;
}
.articletext{
font-size: 14px;
line-height: 24px;
}
.author{
font-size: 13px;
}
.tag{
font-size: 13px;
}
.fab{
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.subfab{
background-color: #fff;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.footer{
font-size: 12px;
text-align: center;
color: #fff;
text-shadow: 1px 1px rgba(55, 55, 55, 0.3);
}
.footer a{
color: #fff;
text-shadow: 1px 1px rgba(175, 175, 175, 0.3);
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
}
.footer a:hover{
border-bottom-color: #fff;
}
@media screen and (min-width: 1440px) {
.nav{
background-color: rgba(255, 255, 255, 0.8);
}
}
/*# sourceMappingURL=background-img.css.map */

File diff suppressed because one or more lines are too long

View file

@ -1,147 +1,3 @@
/*
The MIT License
body{font-family:"Roboto", sans-serif;background:#303030;color:#fff}.header{background-color:#212121;position:fixed;box-shadow:2px 0 2px 2px rgba(32,32,32,0.85)}.title{color:#fff;position:absolute}.title>a{color:#fff}.fadeout{background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, #212121 100%)}.nav{background-color:#424242;border-right:1px solid #1f1f1f}.nav-item,.nav-item-static{color:#fff}.nav-item{font-weight:600}.nav-item:active{background-color:#383838}.divider{border-bottom:1px solid #1f1f1f}.card{background:#424242;border-radius:2px;box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65)}.card a{color:#ff4415;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#ff4415}.headline{font-size:24px;color:#fff !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#ff4415 !important}.date{font-size:13px}.articletext{font-size:14px;line-height:24px}.author,.tag{font-size:13px}.fab{background-color:#ff4415;box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65)}.subfab{background-color:#424242;box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65)}.button{text-transform:uppercase;border-width:1px;border-style:solid;-webkit-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);-moz-box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);box-shadow:0 1px 1.5px 1.5px rgba(42,42,42,0.65);border-radius:2px;letter-spacing:0.4px;font-weight:700;font-size:14px;transition-property:box-shadow;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-o-transition-property:box-shadow;-o-transition-delay:50ms;-o-transition-duration:125ms;-o-transition-timing-function:ease;-moz-transition-property:box-shadow;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:box-shadow;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover{-webkit-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);-moz-box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85);box-shadow:0.5px 1.8px 2.1px 1.4px rgba(32,32,32,0.85)}.pag_next{background-color:#ff4415;border-color:#ff4415}.pag_prev{background-color:#424242;border-color:#424242;color:#CCCCCC}.footer{font-size:12px;text-align:center;color:#fff}.footer a{color:#fff;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent}.footer a:hover{border-bottom-color:#fff}
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 6:39:37 PM
Author : mmk2410
*/
body{
font-family: "Roboto", sans-serif;
background: #303030;
color: #fff;
}
.header{
background-color: #212121;
position: fixed;
box-shadow: 2px 0px 2px 2px rgba(32, 32, 32, 0.85);
}
.title{
color: #fff;
position: absolute;
}
.title > a{
color: #fff;
}
.fadeout{
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, #212121 100%); /* FF3.6+ */
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,#212121 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,#212121 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,#212121 100%); /* IE10+ */
background: linear-gradient(to right, rgba(30,87,153,0) 0%,#212121 100%); /* W3C */
}
.nav{
background-color: #424242;
border-right: 1px solid #1f1f1f;
}
.nav-item, .nav-item-static{
color: #fff;
}
.nav-item{
font-weight: 600;
}
.nav-item:active{
background-color: #383838;
}
.divider{
border-bottom: 1px solid #1f1f1f;
}
.card{
background: #424242;
border-radius: 2px;
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
}
.card a{
color: #ff4415;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.card a:hover{
border-bottom-color: #ff4415;
}
.headline{
font-size: 24px;
color: #fff!important;
text-decoration: none;
border-bottom: none!important;
}
.date{
font-size: 13px;
}
.articletext{
font-size: 14px;
line-height: 24px;
}
.author{
font-size: 13px;
}
.tag{
font-size: 13px;
}
.fab{
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
}
.subfab{
background-color: #424242;
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
}
.footer{
font-size: 12px;
text-align: center;
color: #fff;
}
.footer a{
color: #fff;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
}
.footer a:hover{
border-bottom-color: #fff;
}
/*# sourceMappingURL=material-dark.css.map */

File diff suppressed because one or more lines are too long

View file

@ -1,146 +1,3 @@
/*
The MIT License
body{font-family:"Roboto", sans-serif;background:#f6f6f6;color:#383838}.header{background-color:#ff4415;position:fixed;box-shadow:2px 0 2px 2px rgba(62,62,62,0.45)}.title{color:#fff;position:absolute}.title>a{color:#fff}.fadeout{background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, #ff4415 100%)}.nav{background-color:#fff;border-right:1px solid #e0e0e0}.nav-item,.nav-item-static{color:#383838}.nav-item{font-weight:600}.nav-item:hover,.nav-item:active{background-color:#e2e2e2}.divider{border-bottom:1px solid #e0e0e0}.card{background:#fff;border-radius:2px;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.card a{color:#ff4415;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#ff4415}.headline{font-size:24px;color:#383838 !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#ff4415 !important}.date{font-size:13px}.articletext{font-size:14px;line-height:24px}.author,.tag{font-size:13px}.fab{background-color:#ff4415;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.subfab{background-color:#fff;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.button{text-transform:uppercase;border-width:1px;border-style:solid;-webkit-box-shadow:0.4px 1px 1.5px 1px #aaa;-moz-box-shadow:0.4px 1px 1.5px 1px #aaa;box-shadow:0.4px 1px 1.5px 1px #aaa;border-radius:2px;letter-spacing:0.4px;font-weight:700;font-size:14px;transition-property:box-shadow;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-o-transition-property:box-shadow;-o-transition-delay:50ms;-o-transition-duration:125ms;-o-transition-timing-function:ease;-moz-transition-property:box-shadow;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:box-shadow;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover{-webkit-box-shadow:0.5px 1.8px 2.1px 1.4px #aaa;-moz-box-shadow:0.5px 1.8px 2.1px 1.4px #aaa;box-shadow:0.5px 1.8px 2.1px 1.4px #aaa}.pag_next{background-color:#ff4415;border-color:#ff4415}.pag_prev{background-color:#fff;border-color:#fff;color:#383838}.footer{font-size:12px;text-align:center}.footer a{color:#383838;text-decoration:none;border-bottom:1px solid transparent;border-bottom-color:transparent}.footer a:hover{border-bottom-color:#383838}
Copyright 2015 mmk2410.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
Created on : Jun 18, 2015, 6:39:37 PM
Author : mmk2410
*/
body{
font-family: "Roboto", sans-serif;
background: #f6f6f6;
color: #383838;
}
.header{
background-color: #ff4415;
position: fixed;
box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45);
}
.title{
color: #fff;
position: absolute;
}
.title > a{
color: #fff;
}
.fadeout{
background: -moz-linear-gradient(left, rgba(30,87,153,0) 0%, #ff4415 100%); /* FF3.6+ */
background: -webkit-linear-gradient(left, rgba(30,87,153,0) 0%,#ff4415 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(30,87,153,0) 0%,#ff4415 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(30,87,153,0) 0%,#ff4415 100%); /* IE10+ */
background: linear-gradient(to right, rgba(30,87,153,0) 0%,#ff4415 100%); /* W3C */
}
.nav{
background-color: #fff;
border-right: 1px solid #e0e0e0;
}
.nav-item, .nav-item-static{
color: #383838;
}
.nav-item{
font-weight: 600;
}
.nav-item:active{
background-color: #e2e2e2;
}
.divider{
border-bottom: 1px solid #e0e0e0;
}
.card{
background: #fff;
border-radius: 2px;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.card a{
color: #ff4415;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
transition: border-bottom-color 150ms ease-in-out 100ms;
}
.card a:hover{
border-bottom-color: #ff4415;
}
.headline{
font-size: 24px;
color: #383838!important;
text-decoration: none;
border-bottom: none!important;
}
.date{
font-size: 13px;
}
.articletext{
font-size: 14px;
line-height: 24px;
}
.author{
font-size: 13px;
}
.tag{
font-size: 13px;
}
.fab{
background-color: #ff4415;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.subfab{
background-color: #fff;
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
.footer{
font-size: 12px;
text-align: center;
}
.footer a{
color: #383838;
text-decoration: none;
border-bottom: 1px solid transparent;
border-bottom-color: transparent;
}
.footer a:hover{
border-bottom-color: #383838;
}
/*# sourceMappingURL=material-light.css.map */

File diff suppressed because one or more lines are too long

3
themes/nextDESIGN.css Normal file
View file

@ -0,0 +1,3 @@
body{font-family:"Fira Sans",sans-serif;background:#f0f0f0;color:#383838;margin:130px 0 0}::selection,::-moz-selection{color:#f0f0f0;background-color:#4CAF50}.header{height:55px;background-color:#4CAF50;position:fixed;box-shadow:2px 0 2px 2px rgba(62,62,62,0.45)}.title{line-height:55px;color:#fff;position:absolute;left:0;margin-left:calc(20% + 24px)}.title>a{color:#fff;text-decoration:none}.fadeout{height:55px;background:-moz-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:-webkit-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:-o-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:-ms-linear-gradient(left, rgba(30,87,153,0) 0%, #4CAF50 100%);background:linear-gradient(to right, rgba(30,87,153,0) 0%, #4CAF50 100%)}.nav-img{padding:14px 19px}.nav{background-color:#fff;border-right:1px solid #e0e0e0}.nav-item,.nav-item-static{color:#383838}.nav-item{font-weight:600}.nav-item:hover{color:#4CAF50}.nav-item:active{background-color:#e2e2e2}.divider{border-bottom:1px solid #e0e0e0}.card{background:none;border-radius:0;box-shadow:none;margin:0 20% 100px;width:auto}.card a{color:#4CAF50;text-decoration:none;border-bottom:1px solid transparent;transition:border-bottom-color 150ms ease-in-out 100ms}.card a:hover{border-bottom-color:#4CAF50}.headline{font-size:30px;line-height:50px;color:#383838 !important;text-decoration:none;border-bottom:none !important}.headline:hover{color:#4CAF50 !important}.date{font-size:13px}.articletext{margin-top:30px;font-size:16px;line-height:30px}.author,.tag{font-size:13px}.fab{background-color:#4CAF50;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.subfab{background-color:#fff;box-shadow:0 1px 1.5px 1.5px rgba(62,62,62,0.3)}.button{color:#4CAF50;border-bottom:1px solid transparent;margin:0;min-width:0;padding:0;line-height:16px;height:16px;transition-property:border-bottom-color;transition-delay:50ms;transition-duration:125ms;transition-timing-function:ease;-moz-transition-property:border-bottom-color;-moz-transition-delay:50ms;-moz-transition-duration:125ms;-moz-transition-timing-function:ease;-webkit-transition-property:border-bottom-color;-webkit-transition-delay:50ms;-webkit-transition-duration:125ms;-webkit-transition-timing-function:ease}.button:hover{border-bottom-color:#4CAF50}.pag_prev{float:left}.button:last-child{float:none}.footer{text-align:center;height:60px;background-color:#2D2D2D;line-height:60px;width:100%;color:#fff}.footer a{color:#fff;text-decoration:none;border-bottom:1px solid transparent}.footer a:hover{border-bottom-color:#fff}.hljs{background:none}@media screen and (min-width: 1440px){.title{margin-left:calc(20% - 40px)}.nav{padding-top:55px}}@media screen and (max-width: 800px){body{margin-top:80px}.title{margin-left:20%}.card{margin:0 5% 100px}}
/*# sourceMappingURL=nextDESIGN.css.map */

File diff suppressed because one or more lines are too long

36
update-scripts/1-0-0_1-1-0.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/bash
# Script for updating Rangitaki 1.0.0 to 1.1.0
# WARNING: Rangitaki 1.1.0 is for testing purposes only
echo "WARNING: You're about to install a testing version of Rangitaki."
read -r -p "Do you want to continue? (y/N) " answer
if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
# Getting the up to date version
mkdir ./rbe-new
cd ./rbe-new || exit
wget -c https://github.com/mmk2410/Rangitaki/archive/v1.1.0.zip
unzip v1.1.0.zip
rm v1.1.0.zip
mv ./rangitaki-1.1.0/* ./
rm ./rangitaki-1.1.0
cd ../ || exit
# Creating temporary directory
mkdir rbe-tmp
# Updating rcc
cp ./rcc/password.php ./rbe-tmp/
rm -rf ./rcc
mv ./rbe-new/rcc ./
rm ./rcc/password.php
mv ./rbe-tmp/password.php ./rcc/
# Updating ressources
rm -rf ./res
mv ./rbe-new/res ./
# Updating index.php
rm ./index.php
mv ./rbe-new/index.php ./
# Updating themes
rm ./themes/material-light.css
mv ./rbe-new/themes/material-light.css ./themes
# cleaning up
rm -rf ./rbe-new
rm -rf ./rbe-tmp
fi

49
update-scripts/1-0-0_1-2-0.sh Executable file
View file

@ -0,0 +1,49 @@
#!/bin/bash
# Update script for Rangitaki from version 1.0.0 to 1.2.0
echo "Downloading version 1.2.0..."
mkdir ./rbe-new
cd ./rbe-new || exit
wget -c https://github.com/mmk2410/Rangitaki/archive/v1.2.0.zip
unzip v1.2.0.zip
rm v1.2.0.zip
mv ./rangitaki-1.2.0/* ./
rm ./rangitaki-1.2.0
cd ../ || exit
mkdir rbe-tmp
echo "Updating RCC..."
cp ./rcc/password.php ./rbe-tmp/
rm -rf ./rcc
mv ./rbe-new/rcc ./
rm ./rcc/password.php
mv ./rbe-tmp/password.php ./rcc/
echo "Updating ressources..."
rm -rf ./res
mv ./rbe-new/res ./
echo "Updating core..."
rm ./index.php
mv ./rbe-new/index.php ./
echo "Updating themes..."
rm ./themes/material-light.css
mv ./rbe-new/themes/material-light.css ./themes
echo "Creating empty extension directory..."
mkdir ./extensions
echo "Update themes..."
rm ./themes/background-img.css
rm ./themes/material-dark.css
rm ./themes/material-light.css
mv ./rbe-new/themes/background-img.css ./themes/
mv ./rbe-new/themes/material-dark.css ./themes/
mv ./rbe-new/themes/material-light.css ./themes/
echo "Update config file..."
echo "// pagination: how many articles should be on one page" >> ./config.php
echo "// set to 0 to disable it" >> ./config.php
echo "\$pagination = 0;" >> ./config.php
echo "Update languages..."
rm ./lang/en.php
rm ./lang/de.php
mv ./rbe-new/lang/en.php ./lang/
mv ./rbe-new/lang/de.php ./lang/
echo "Cleaning up..."
rm -rf ./rbe-new
rm -rf ./rbe-tmp
echo "Done!"

34
update-scripts/1-1-0_1-1-1.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/bash
# Script for updating Rangitaki 1.1.0 to 1.1.1
# WARNING: Rangitaki 1.1.1 is for testing purposes only
echo "WARNING: You're about to install a testing version of Rangitaki."
read -r -p "Do you want to continue? (y/N) " answer
if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
# Getting the up to date version
mkdir ./rbe-new
cd ./rbe-new || exit
wget -c https://github.com/mmk2410/Rangitaki/archive/v1.1.1.zip
unzip v1.1.1.zip
rm v1.1.1.zip
mv ./rangitaki-1.1.1/* ./
rm -rf ./rangitaki-1.1.1
cd ../ || exit
# Creating temporary directory
mkdir rbe-tmp
# Updating rcc
cp ./rcc/password.php ./rbe-tmp/
rm -rf ./rcc
mv ./rbe-new/rcc ./
mv ./rbe-tmp/password.php ./rcc/
# Updating ressources
rm -rf ./res
mv ./rbe-new/res ./
# Updating index.php
rm ./index.php
mv ./rbe-new/index.php ./
# creating empty extension directory
mkdir ./extensions
# cleaning up
rm -rf ./rbe-new
rm -rf ./rbe-tmp
fi

36
update-scripts/1-1-1_1-1-2.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/bash
# Script for updating Rangitaki 1.1.1 to 1.1.2
# WARNING: Rangitaki 1.1.2 is for testing purposes only
echo "WARNING: You're about to install a testing version of Rangitaki."
read -r -p "Do you want to continue? (y/N) " answer
if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
echo "Getting the up-to-date version..."
mkdir ./rbe-new
cd ./rbe-new || exit
wget -q -c https://github.com/mmk2410/Rangitaki/archive/v1.1.2.zip
unzip -qq v1.1.2.zip
rm v1.1.2.zip
mv ./rangitaki-1.1.2/* ./
rm -rf ./rangitaki-1.1.2
cd ../ || exit
echo "Updating ressources..."
rm -rf ./res
mv ./rbe-new/res ./
echo "Updating index.php..."
rm ./index.php
mv ./rbe-new/index.php ./
echo "Update themes..."
rm ./themes/background-img.css
rm ./themes/material-dark.css
rm ./themes/material-light.css
mv ./rbe-new/themes/background-img.css ./themes/
mv ./rbe-new/themes/material-dark.css ./themes/
mv ./rbe-new/themes/material-light.css ./themes/
echo "Update config file..."
echo "// pagination: how many articles should be on one page" >> ./config.php
echo "// set to 0 to disable it" >> ./config.php
echo "\$pagination = 0;" >> ./config.php
echo "Cleaning up..."
rm -rf ./rbe-new
echo "Done!"
fi

34
update-scripts/1-1-2_1-1-90.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/bash
# Script for updating Rangitaki 1.1.2 to 1.1.90
# WARNING: Rangitaki 1.1.90 is for testing purposes only
echo "WARNING: You're about to install a testing version of Rangitaki."
read -r -p "Do you want to continue? (y/N) " answer
if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
echo "Getting the up-to-date version..."
mkdir ./rbe-new
cd ./rbe-new || exit
wget -q -c https://github.com/mmk2410/Rangitaki/archive/v1.1.90.zip
unzip -qq v1.1.90.zip
rm v1.1.90.zip
mv ./rangitaki-1.1.90/* ./
rm -rf ./rangitaki-1.1.90
cd ../ || exit
echo "Updating ressources..."
rm -rf ./res
mv ./rbe-new/res ./
echo "Update languages..."
rm ./lang/en.php
rm ./lang/de.php
mv ./rbe-new/lang/en.php ./lang/
mv ./rbe-new/lang/de.php ./lang/
echo "Update themes..."
rm ./themes/background-img.css
rm ./themes/material-dark.css
rm ./themes/material-light.css
mv ./rbe-new/themes/background-img.css ./themes/
mv ./rbe-new/themes/material-dark.css ./themes/
mv ./rbe-new/themes/material-light.css ./themes/
echo "Cleaning up..."
rm -rf ./rbe-new
echo "Done!"
fi

Some files were not shown because too many files have changed in this diff Show more