
Publish – A static site generator for Swift developers - _quhg
https://github.com/johnsundell/publish
======
dhsysusbsjsi
John Sundell is awesome. Other stuff he’s done:

Plot: Write type safe HTML/RSS/XML in Swift
[https://github.com/JohnSundell/Plot](https://github.com/JohnSundell/Plot)

Ink: Converts markdown to HTML
[https://github.com/JohnSundell/Ink](https://github.com/JohnSundell/Ink)

Swift by Sundell blog
[https://www.swiftbysundell.com/](https://www.swiftbysundell.com/)

Podcast
[https://www.swiftbysundell.com/podcast](https://www.swiftbysundell.com/podcast)

I really love these lightweight, JavaScript free websites he’s helping create
in Swift. It’s such a better experience loading and reading than other blogs -
the inlined sponsor/ads even look nice and don’t feel overwhelming or annoying
(I usually read them!).

~~~
dep_b
Yeah the sponsor ads are great. They're hyper focused on my interest while
they know nothing about me when I visit the website. Golly I wish how they
would do it! Sometimes I get to know iOS development related products that I
didn't know about but should have. Think they had about the same click-through
rate as all of the other banners I've seen last year combined.

On the other hand Google seems to think I need a Foreverspin after carefully
analyzing all of my click behavior over thousands of websites.

------
modernerd
Great to see Swift being used outside of macOS/iOS.

Is this increasingly common?

Is it worth learning and adopting Swift as an alternative to Rust/Go/Dart, for
example? It feels like it could be a strong general purpose language.

It seems a shame to restrict the language to Apple's ecosystem only. Apple's
own docs make it sound like use cases outside of the Apple ecosystem are being
left to the community; that Apple does not have any intention to make the
language have broader appeal itself:
[https://developer.apple.com/swift/#xplatform](https://developer.apple.com/swift/#xplatform)

~~~
michaelbrave
I believe it's a capable language and I hope to use it more like that in the
future.

Right now there are things like:

-vapor: [https://vapor.codes/](https://vapor.codes/) to do server things

-tensorflow swift: [https://www.tensorflow.org/swift](https://www.tensorflow.org/swift) for machine learning at a lower level than python, meant to replace a lot of the work that ends up being done in c++

One of the biggest problems is that it isn't as cross platform as we want it
to be yet (it kinda works on windows now:
[https://swiftforwindows.github.io/](https://swiftforwindows.github.io/) \-
but not for 5.0 yet), some of the more recent changes to the language are
setting it up to be more cross platform as well, but I've forgotten the
specific term. Also a lot of libraries on linux don't work quite the same as
MacOS or are incomplete/missing. The biggest hold-back though that and the
public opinion seems to be that swift == IOS dev.

The only way I can think to change that opinion is to build something
incredible first and then let everyone react with "you can do that? I didn't
think you could do that, wow".

------
carapace
What's a good data type for text with hyperlinks?

~~~
layoutIfNeeded
A tree?

~~~
TheAsprngHacker
Since hyperlinks can link to any document, not just children, shouldn't the
data structure be a (not necessarily tree-shaped) directed graph?

~~~
carapace
I can't even decide whether the text (e.g. in a div or p element) should be
stored as a unit with links stored as meta-data, or should the stretches of
text before/after/between links be "chunks" and the links store their own
content (like DOM)?

It's an old question, see the "piece-chain" structure Prof With chose for
text-with-"looks" (aka "style")
[http://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Syste...](http://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.System.pdf)
section 5.2, "Text Management".

~~~
layoutIfNeeded
The former is how NSAttributedString works in the Apple ecosystem. It’s a
plain string with attributes attached to certain character ranges.

[https://developer.apple.com/documentation/foundation/nsattri...](https://developer.apple.com/documentation/foundation/nsattributedstring)

------
wiggler00m
Like this idea in theory.

The author's site (built with Publish) seems slow to me. Cause unknown. Would
like to see more examples.

[https://swiftbysundell.com/](https://swiftbysundell.com/)

~~~
jaunkst
It's fast. It's static. CDN as mentioned. Nothing impressive here though. This
wheel has been done.

~~~
PunksATawnyFill
By?

