Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Theme assets rely on other websites #62

Closed
scateu opened this issue Sep 11, 2015 · 16 comments
Closed

Theme assets rely on other websites #62

scateu opened this issue Sep 11, 2015 · 16 comments
Assignees

Comments

@scateu
Copy link

scateu commented Sep 11, 2015

For example, some theme still uses google fonts, which makes loading a bit slow.

https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700

As for theme chaitin, it loads png file from http://blog.chaitin.com/img/topbar.png

@pandada8
Copy link
Member

well, the chaitin top png is loaded as designed……maybe we could embed the png in the css.

As the google font part, I don't think it is an issue.
the server would release a _static folder in your git folder, you can modify the css file manually

anyway, thanks for your feedback

@zTrix
Copy link
Member

zTrix commented Sep 12, 2015

I think chaitin top png should be packed into _static folder, while google fonts shall be kept where they are now.

@scateu
Copy link
Author

scateu commented Sep 13, 2015

oh... when you are offline, and your strapdown-server is running on your
own laptop, your webpage is blocked, which is pretty annoying.

And this did happen once when I was working on subway where cellular
signal is poor.

So I think as for personal knowledge management, all assets packed into
_static folder is necessary.

Besides, google fonts loading is very very slow inside China.

@zTrix
Copy link
Member

zTrix commented Sep 13, 2015

@pandada8 @cbmixx What do you think?

@pandada8
Copy link
Member

Should we have a special build for blocked user ? 🌚
@zTrix btw, i prefer put the png into the css

@pandada8
Copy link
Member

another very tricky way

  • load the css with ajax
  • find out what google font css loaded using regex
  • load the font with the google webfont js loader
  • put extra css in the head style

I am sure this can work……just to be too complicated
(yet another webpack? 🌚 )
BTW, this may solve the tricky theme switch better

@zTrix
Copy link
Member

zTrix commented Sep 14, 2015

I think @scateu 's scenario makes sense. Pack all the png and fonts into _static is useful for those network censored.

@pandada8
Copy link
Member

just to remember our binary is 15M……
edit: sorry, i click the close button by accident

@pandada8 pandada8 reopened this Sep 14, 2015
@zTrix
Copy link
Member

zTrix commented Sep 15, 2015

With fonts builtin, what's the expected size of the binary?

@pandada8
Copy link
Member

font-family: 'Open Sans', sans-serif;
font-family: 'Lato', sans-serif;
font-family: 'News Cycle', sans-serif;
font-family: 'Source Sans Pro', sans-serif;
font-family: 'Roboto', sans-serif;
font-family: 'Raleway', sans-serif;
font-family: 'Crete Round', serif;
font-family: 'Ubuntu', sans-serif;
font-family: 'Lobster', cursive;
font-family: 'Cabin', sans-serif;

Click the download button we got a 6.1MB zip and unzipped 13M fonts……

@zTrix
Copy link
Member

zTrix commented Sep 15, 2015

0ops...

@pandada8
Copy link
Member

So……
I am going to using #62 (comment)

@zTrix
Copy link
Member

zTrix commented Sep 18, 2015

But it does not solve the problem that when network condition is bad or unavailable.

@pandada8
Copy link
Member

@zTrix actually it solves
when the network is bad, the font won't load. But because it's loading by js, so we only got a page with unfancy font and a connection error in network tab of the chrome dev tools, which I think is acceptable.
BTW. we could smooth the reflow caused by the themes change at the same time

@pandada8
Copy link
Member

pandada8 commented Nov 8, 2015

finished in #77 using bundled font

@zTrix
Copy link
Member

zTrix commented Nov 8, 2015

@scateu High Speed Railway Mode finally supported in commit a425d8f LOL!

@zTrix zTrix closed this as completed Nov 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants