~cadence/bibliogram

4607b1264e6c370707cc504aa9995ed601c74b30 — Cadence Ember 3 months ago 39c8d71 posts-only-mode
Posts only mode
M src/site/api/routes.js => src/site/api/routes.js +4 -0
@@ 76,6 76,8 @@ module.exports = [
	},
	{
		route: `/u`, methods: ["GET"], code: async ({url}) => {
			return render(403, "pug/posts_only.pug")

			if (url.searchParams.has("u")) {
				let username = url.searchParams.get("u")
				username = username.replace(/^(https?:\/\/)?([a-z]+\.)?instagram\.com\//, "")


@@ 96,6 98,8 @@ module.exports = [
	},
	{
		route: `/u/(${constants.external.username_regex})(/channel)?`, methods: ["GET"], code: async ({req, url, fill}) => {
			return render(403, "pug/posts_only.pug")

			const username = fill[0]
			const type = fill[1] ? "igtv" : "timeline"


M src/site/pug/home.pug => src/site/pug/home.pug +6 -10
@@ 15,26 15,22 @@ html(lang=settings.language)
		.go-sections-container(dir=ll.meta_direction)
			.go-sections
				section
					h2.title= ll.go_to_profile
					form(method="get" action="/u" class=`dir-${ll.meta_direction}`).pair-entry
						input(type="text" name="u" placeholder=ll.go_username_or_url).text
						input(type="submit" value=ll.go_button).button
				section
					h2.title= ll.go_to_post
					form(method="get" action="/p" class=`dir-${ll.meta_direction}`).pair-entry
						input(type="text" name="p" placeholder=ll.go_shortcode_or_url).text
						input(type="submit" value=ll.go_button).button

		.about-container(dir=ll.meta_direction)
			section.notice
				section.about
					h2 Bibliogram is discontinued
					p You can't view profiles anymore. You can only view individual posts.
					p #[a(href="https://cadence.moe/blog/2022-09-01-discontinuing-bibliogram") Nooo! Why discontinued?]

			section.about
				h2= ll.about_bibliogram_header
				!= ll.pug_about_bibliogram_content({link_to_featured_profiles: constants.featured_profiles.length})

			.notice
				section.about
					h2= ll.experiencing_problems_header
					p: a(href="https://lists.sr.ht/~cadence/bibliogram-announce/%3C20201218014302.855fa8a816be2f19da2f56e3%40disroot.org%3E")= ll.t_read_more_here

			section.about
				h2= ll.about_this_instance_header
				ul

A src/site/pug/posts_only.pug => src/site/pug/posts_only.pug +12 -0
@@ 0,0 1,12 @@
include includes/error.pug

doctype html
html
	head
		title= `Only posts are available | Bibliogram`
		include includes/head
	body.error-page
		+error(403, "Only posts are available", false)
			| Bibliogram is discontinued.
			| You can only view individual posts, not user profiles.
			| #[a(href="https://cadence.moe/blog/2022-09-01-discontinuing-bibliogram") Nooo! Why discontinued?]

M src/site/sass/includes/_main.sass => src/site/sass/includes/_main.sass +6 -6
@@ 665,15 665,10 @@ body
	.about-container
		background-color: map-get($theme, "background-power-secondary")
		color: map-get($theme, "foreground-power-secondary")
		padding: 50px 0px
		padding: 0px 0px 50px
		flex: 1
		min-height: 60vh

		.notice
			background-color: map-get($theme, "background-power-tertiary")
			margin: 10px 0px
			padding: 20px 0px 10px

		.about
			max-width: 700px
			margin: 0px auto


@@ 687,6 682,11 @@ body
			.link-list
				color: map-get($theme, "link-power")

		.notice
			background-color: map-get($theme, "background-power-tertiary")
			margin: 0px 0px 50px
			padding: 20px 0px 10px

	.featured-profiles
		margin-bottom: 20px
		line-height: 1.4