GoBlue Theme (Local Fonts) Download 8.0

German Dominik L 1 year ago

Permission granted by Arsalan Shah

This is the original GoBlue Theme by OSSN but with local Google Fonts and "Font Awesome" by cloudflare.

In the GoBlue Theme provided by OSSN the Google Fonts are taken directly from the Google servers, but that is a problem in Europe, so I took the GoBlue theme and replaced the google fonts server call with local fonts in the "fonts" folder, same I did for Cloudflare stuff.

How did I archieved that?

I replaced the google fonts URL in ossn_theme.xml with a local version:

$head[] = ossn_html_css(array(
    'href' => ossn_theme_url() . 'fonts/fonts.php',
));

and downloaded the fonts from google into fonts folder

Updated to 8.0

Comments
German Michael Zülsdorff Replied 1 year ago

Next issue (v7.8):

goblue/plugins/default/css/core/administrator.php

is awaiting

body {
font-family: 'Roboto Slab', serif;
font-size: 14px;

}

but you changed ossn_goblue_admin_head()

to no longer load that font -
making the complete admin backend look different.

German Dominik L Replied 1 year ago

I renamed the file, thanks

German Michael Zülsdorff Replied 1 year ago

Just a little explanation why former version 7.6 denied to load PTSans:

As you wrote, you are starting with

$head[] = ossn_html_css(array(
    'href' => ossn_theme_url() . 'fonts/fonts.php',
));

So let's have a look into libraries/ossn.lib.css.php and see what ossn_html_css() does ...

function ossn_html_css($args) {
	if(!is_array($args)) {
			return false;
	}
	$default = array(
			'rel' => 'stylesheet',
			'type' => 'text/css'
	);
	$args    = array_merge($default, $args);
	return "\r\n<link " . ossn_args($args) . " />";

}
It returns a line like

<link rel="stylesheet" type="text/css" href="https://minimickl.fritz.box/themes/goblue/fonts/fonts.php">

That's your file plus the Mime type "text/css" added
And using the developer console we can actually find this line inside the <head> part of our site.


Now, after switching to the Network tab doing a reload and checking fonts.php

![enter image description here][ATTACHMENT:7354]

we find the SAME text/css being part of the REQUEST HEADER
but the RESPONSE HEADER comes up with a different Mime type of text/html

That is: Mime types differ, and that's why the browser stops further loading.

By default, all files named .php are returned as text/html by todays servers
and that's why it needed your workaround by issuing an extra header in the beginning

  <?php
header("Content-type: text/css; charset=UTF-8");
?>

to 'convince' the browser it's really CSS.
The much smarter way would be simply renaming that file to fonts.css
[ATTACHMENT:7354]: https://www.opensource-socialnetwork.org/photoattachment/7354/goblue-fonts-request.jpg

German Michael Zülsdorff Replied 1 year ago

Next release will be also with cloudflare replacement

I'd very much appreciate you would provide a COMPLETE AND WORKING release first, before adding any new features.

Dutch Eric redegeld Replied 1 year ago

i was ending up adding two folders in to vendors.
vendors/fontaweson
vendors/jqueryui
And this works

German Dominik L Replied 1 year ago

Next release will be also with cloudflare replacement

Dutch Eric redegeld Replied 1 year ago

got it also working
https://shadow.nlsociaal.nl/home
all local including cloudflare

German Michael Zülsdorff Replied 1 year ago

Wow, yeah: PTSans are working now!
The solution is a little surprising, though. I mean:
Why requesting php to issue that header - resulting in a little more system load and extra traffic?
Why not simply providing a pure CSS file named fonts.css as expected by the browser instead of fonts.php?

But new issue: fontawesome is missing now.
You added

	$head[] = ossn_html_css(array(
    'href' => ossn_theme_url() . 'fonts/fontawesome.css',
));

but fontawesome.css is missing.

German Dominik L Replied 1 year ago

I found it

I finally found it

Will prepare the package now

enter image description here

German Dominik L Replied 1 year ago

I'm giving up

don't have any time or nerves to get this working at the moment...

Component

Developer: Dominik
License ossnv4
Type: Themes
Requires OSSN Version : 8.0
Latest Version: 8.0
Last Updated 11 months ago
Repository Url View Repository