c-hive / dotdev

Next.js SPA professional website template for teams and individuals: https://c-hive.github.io/dotdev/
MIT License
0 stars 1 forks source link

Migrate JSON configs to YAML #106

Closed gomorizsolt closed 4 years ago

gomorizsolt commented 4 years ago

Issue #91.

gomorizsolt commented 4 years ago

Tasks that have yet to be done to make the PR ready for review:

gomorizsolt commented 4 years ago

@thisismydesign FYI, I've removed the configJSON from the secrets and added CONFIG with the values from config.yml.

gomorizsolt commented 4 years ago

Screenshot 2020-04-15 at 20 22 36

This error pops up for some reason. AFAICT it originates from the <Medium /> component. I'll look into it.

gomorizsolt commented 4 years ago

https://github.com/c-hive/dotdev/pull/106#issuecomment-614203004 => https://github.com/c-hive/dotdev/pull/106/commits/fc9d9e72d4478d76656170d80c58df17a3b4da83

It'd be great to make it less error-prone though, i.e. the / at the end of the URL might not be added.

const slashRequired = proxy[proxy.length -1] === "/";
const feedUrl = `${proxy}{${slashRequired} ? "/" : ""}https://medium.com/feed/${username}`;

How about something like the above? Or let's just mention it somewhere in the doc.

thisismydesign commented 4 years ago

It'd be great to make it less error-prone though, i.e. the / at the end of the URL might not be added.

The proper way of dealing with this is through a library that can parse and construct URLs/URIs. They should have a method for adding paths.

gomorizsolt commented 4 years ago

It'd be great to make it less error-prone though, i.e. the / at the end of the URL might not be added.

The proper way of dealing with this is through a library that can parse and construct URLs/URIs. They should have a method for adding paths.

Gotcha, thanks.

https://github.com/c-hive/dotdev/blob/de0369f90f27079d7839884f440543603d7d2e81/src/components/Medium/utils/MediumUtils.js#L6-L12.